[an error occurred while processing this directive]

Printer Sharing: Suse/openSUSE 10.x 11.x IPP Print Server for Linux & Windows Clients

Simply put: it's about printing to a Linux computer from either a Linux computer or a Windows computer using the Internet Printing Protocol, IPP

Versions: Suse / openSUSE 10.0, 10.1, 10.2, 10,3, 11.0, 11.1

In this tutorial you share a printer on a Linux host as a print server for both Windows and Linux clients using the Internet Printing Protocol (IPP). An alternative protocol, netBIOS over TCPIP (NBT or Samba) is covered in a separate Tutorial: Linux Samba Printer Sharing. I think that sharing a printer by IPP is easier than sharing by Samba. The reverse scenario where you share a printer on a Windows host as a print server for Linux clients is covered in a third Tutorial: Windows Printer Sharing. This HowTo assumes CUPS is used for printing. Also note that IPP printing is independent of Samba. Samba does not need to be running.

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.

Discover Information about the Server: Regardless of which form of IP addressing you use, you'll need the IP address of the Server for testing TCPIP communications with clients. Issue this command in a terminal as root to get the address: ifconfig. I will use this address for the Server for demonstration purposes here: 192.168.2.2 and for the hostname I'll use "suseserver".

Next we need some information about the printer on the server. I've assumed that one has been installed either using Yast or CUPS GUI or other KDE/Gnome methods. The printer name for network purposes is available in the CUPS admin GUI at http://localhost:631/printers (if you're running Linux, click link to see). In my example I have installed a Hewlett Packard LaserJet 1020 printer named "laserjet1020". [View this Pic] Whatever name you find on your Server, it cannot have spaces. Record laserjet1020 exactly for later use. That name is the queuename. Now that you have the server's IP and the printers network name, move on and configure the Server for IPP printing.

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, so either open that port or turn the firewall off temporarily. You can open Port 631 in Yast --> Firewall --> Allowed Services --> Services to Allow --> Cups.

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. For openSUSE 11.0 & 11.1 supply the credentials for the Linux root user. In Suse Linux 10.x and openSUSE 10.x, the process changed over time from this command in a console: sudo lppasswd -a username to this command in a console: sudo lppasswd -g sys -a root.

Starting CUPS: Make sure CUPS is set to always start on booting: GoTo Yast --> System ---> System Services (Runlevels) --> Expert Mode --> cups = yes + runlevels 2, 3 and 5 --> Finish. Also, when you make changes to the CUPS configuration file you need to restart cups with this root shell command: rccups restart.

Setup the CUPS configuration file on the Server: The cups configuration file is the text file "cupsd.conf", located at /etc/cups/cupsd.conf. You can open a root-owned text file like cupsd.conf with either of these commands in a terminal window:

  • for KDE use kdesu kwrite /etc/cups/cupsd.conf
  • for Gnome use gnomesu gedit /etc/cups/cupsd.conf

File cupsd.conf is grouped into segments. Locate the segment for each of the three areas below and edit it until it is in the required modified form as displayed below:

1: Advertise printers on local network

# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow @LOCAL

2: Allow LAN printing to the Linux server

# Restrict access to the server...
<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 127.0.0.2
#Allow From @LOCAL
Allow From 192.168.2.*
</Location>

Notice how the local LAN is allowed as 192.168.2.*. Be sure to chage that to match your situation. If you want to allow all subnets, then uncomment the line #Allow From @LOCAL.

3a: Allow CUPS to "Listen" for IPP printing. Use this for Suse 10.0 and 10.1. Simply check that this line is not commented out:

# Ports/addresses that we listen to
Port 631

3b: Allow CUPS to "Listen" for IPP printing. Use this for openSUSE 10.2, 10.3, 11.0, 11.1. Listening on port 631 is closed in releases 10.2 through 11.1 by these lines:

# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock

Comment them out, change the paragraph title and open port 631 as follows:

# Listen to all connections on port 631.
#Listen localhost:631
#Listen /var/run/cups/cups.sock
Port 631

Here's an alternative to the configuration immediately above, (only for openSUSE 10.2 onwards). Advanced users only: if you have a server with a fixed IP address you MAY (you don't have to - you just may) you may use this alternative to the Port 631 method. The advantage is increased security:

# Listen to the local machine and to traffic on the interface 192.168.2.2.
Listen localhost:631
Listen 192.168.2.2:631
Listen /var/run/cups/cups.sock
#Port 631

I have attached copies of the files cupsd.conf that I used to test working servers on Suse 10.0 & 10.1 and openSUSE 10.2 & 10.3 and also 11.0 & 11.1. You can compare these with yours.

Check mime types

Check the file /etc/cups/mime.convs and make sure the line containing the following term is uncommented

application/vnd.cups-raw

Check the file /etc/cups/mime.types and make sure the line containing the following term is uncommented

application/octet-stream

If either of these is left undone, you might receive errors like the following:

  • The print job executes on the client but nothing happens on the server
  • Error message like this: Print file was not accepted (unsupported format 'application/octet-stream')
  • Error message like this: Printer busy; will retry in 10 seconds

The work on the server is finished. Now you can configure clients to print to the server.

Check communications between Clients and Server: Do this the same for each Linux and Windows client. Open a terminal or DOS prompt and ping the Server with ping 192.168.2.2. A positive response there is a must before proceeding. Next enter this address in the web browser of the client and look at the installed printer on the server: http://192.168.2.2:631/printers/. Here's a screenshot of what you should see. When you establish these adequate communications you can proceed to configure the client.

Setting up a Linux client for IPP using the CUPS Admin GUI

  • Install the printer drivers for the machine you will access over the network.
  • Open http://localhost:631 in the browser on the client, Go to the Administration tab. Click to Add Printer and enter a printer name, e.g ipplaser, no spaces, and optionally a location and description.
  • In Device for ipplaser, select from the drop-down list Internet Printing Protocol (http).
  • Either enter "Device URI" for fixed addressing: http://192.168.2.2:631/printers/laserjet1020
  • Or enter "Device URI" for DHCP addressing: http://suseserver:631/printers/laserjet1020
  • Select the printer manufacturer from list in cups database
  • Select the printer model from list in cups database
  • Optional: Click printers, click Configure Printer to set formatting settings
  • On the Printers page, click Print Test Page to check connectivity

You should now be printing Linux_to_Linux using IPP/Cups

Setting up a Windows (e.g. XP) client for IPP using the "Printers & Faxes" GUI

  • Install the driver so it will appear in the driver lists in step 7
  • Open "Printers and Faxes" --> Click "Add Printer" --> "Next" in Wizard
  • Select "A network printer or ....." --> Next
  • Do NOT select by browsing. Select option to enter URL
  • Either for fixed addressing enter this URI: http://192.168.2.2:631/printers/laserjet1020
  • Or for DHCP addressing enter this URI: http://suseserver:631/printers/laserjet1020
  • Select the Manufacturer & Model from the lists OR "Have Disk" --> install driver
  • Select the printer model from the list in Windows database
  • Next --> The icon for the IPP printer appears:
    R-click icon, select "Properties" and click "Print test page" to check.

You should now be printing Windows_to_Linux using IPP/Cups.

Credits: This tutorial was stimulated by advice given by broch, Jop, winxp_escapee and oldcpu on the Suse Linux Support Forum.

I Hope this Tutorial makes life a bit easier for you.

Swerdna: 08 Jan 07; last revised 01 Jan 09