Printer Sharing: Windows Print Server for Suse/openSUSE Linux Clients
Simply put: it's about printing to a Windows computer from a Linux computer using Either Samba's SMB/CIFS Protocol or LPD Printing.
In this tutorial you share a printer on a Windows host as a print server for Linux clients using Samba networking. We will discuss two independent, alternative options, namely LPD protocol and SMB (Samba) protocol. This HowTo assumes CUPS is used for printing. Samba of course is installed and running.
The reverse scenario where you share a printer on a Linux host as a print server for Linux clients is covered in two other tutorialsl: Linux IPP Printer Sharing and Linux Samba Printer Sharing.
Fixed IP address or DHCP Addressing? Your print server can have either a fixed or a dynamic (DHCP) IP address. Dynamic addresses are the Suse do-nothing default. Fixed addressing is the Administrator's choice for Linux servers because it's easier to administer. Tip: there's a reason why fixed IP addressing is widely recommended for servers. Here's a tutorial on configuring addressing both ways: HowTo Configure a NIC in Suse/openSUSE.
Setting up the Windows print server.
Share the printer: In this example I have a Canon BJ200 printer shared as CanonBub
. To share a printer do this: Start --> Printers & Faxes --> R-click printer icon --> Sharing --> Share this printer --> Type in your choice for share name. I chose CanonBub for this example. Note there are NO SPACES.
Record your NBT server address: You also want the Windows NBT address which you can get from a dos prompt available at Start --> All Programs --> Accessories --> Command Prompt. In the command prompt enter "ipconfig/all". You'll see the IP address for the ethernet adapter, 192.168.2.4 and the NBT name DragaXP in this example.
You'll need IP if using fixed addressing or NBT name if using dynamic addressing.
Enable Windows support for Unix printing: Open Control Panel --> Add or remove programs --> Add/remove windows components. Scroll down to "Other Network File & Print Services".
Highlight that and select "details". Put a check mark in "Print Services for Unix" and OK/Next or whatever.
Now that Unix services are installed, you activate them as a service: Open Control Panel --> Administrative Tools --> Services (Local) and find
TCP/IP print server. It should be set to "Status= started" and "Start type=Automatic". To change settings you double Lclick the line "TCP/IP print server" and adjust appropriately.![]()
OK, now you have a windows workstation sharing a Windows printer to Linux clients. The next segments show HowTo set up the Linux client to print to this Windows print server, using two alternative network protocols.
Linux Firewall and Ports: You have your network card in the "external" zone of SuSEfirewall2 (note that if it's in the "internal" zone, you're wide open). SuSEfirewall2 blocks the printing port by default, port 631. You can open Port 631 in Yast --> Firewall --> Allowed Services --> Services to Allow --> Cups. Similarly Samba's ports, 135, 137, 138 and 139 are shut unless you open them in Yast (at danger to your Samba setup) or follow the SuSEfirewall2 Tutorial. Tip: turn the firewall off while you get print sharing going, then cope with the firewall.
Authority to change CUPS: When you attempt to make changes in the CUPS admin GUI (which is at http://localhost:631 -- click to see) you'll need a username/password pair. In 10.0 and 10.1 you add a user by entering this command in a terminal: sudo lppasswd -a username. You supply the root password first up, then a password for the user named "username" when asked. In 10.2 and 10.3 you may use root's username/password pair if you wish. If you need to add root to the CUPS authorised users in 10.2/10.3 (test without first) initiate the dialogue this way: sudo lppasswd -g sys -a root.
Setting up a Linux client to print using LPD protocol (alternative to Samba)
Note: the client does NOT use or need Samba for LPD. Open Cups Admin's GUI by entering this address in your browser (or click this link): http://localhost:631 where you can review the existing situation.
. The GUI differs across the various Suse releases. Find the "add Printer" function, click and fill in a useful name and optionally a location & description.![]()
"Continue" on and select "LPD/LPR Host or Printer" as the device type for your CanonBub printer
. Then "continue" and fill in the URI. The server address is DragaXP for dynamic addressing and 192.168.2.4 for fixed addressing - and the exact server queuename is CanonBub. So for dynamic (DHCP) addressing use this address --> lpd://DragaXP/CanonBub and for fixed addressing use this --> lpd://192.168.2.4/CanonBub. Next select the model
and the printer driver.
Finally, you can set the default printer and test the connectivity to the Windows server. You should now be printing from Linux_To_Windows via LPD![]()
That's all for the cups network client on Linux folks. It's really very easy but ONLY if you know how first.
Setting up a Linux client using Samba's SMB/CIFS Protocol (alternative to LPD)
Check that Samba has been configured for cups printing. The [global] entry will contain at least these lines if it has been configured for cups printing.
Open cups admin on http://localhost:631 and execute these steps:
OK folks that it for the Samba client on Linux and for this Tutorial.
Credits: This tutorial was made possible from advice given by broch and winxp_escapee in the Suse Linux Support Forum..
Hope this Tutorial makes life a bit easier for you.
Swerdna: 31 December 2006; revised 29 October 07