12.4.�Configuring the Printer SUSE LINUX�–�Administration Guide Chapter�12.�Printer Operation�/�12.4.�Configuring the Printer 12.3.�Installing the Software 12.5.�Special Features in SUSE LINUX 12.4.�Configuring the Printer After connecting the printer to the computer and installing the software, the printer must be installed in the system. If possible, this should be done with the tools delivered with SUSE LINUX. Because SUSE LINUX puts great emphasis on security, third-party tools often have difficulties with the security restrictions and end up causing more complications than benefits. 12.4.1.�Local Printers If an unconfigured local printer is detected when you log in, YaST starts for configuring it. The procedure is described in 2.4.2.4. “Configuration with YaST”. To configure the printer manually with command-line tools (see 12.4.3.3. “Configuring with Command-Line Tools”), you need a device URI (uniform resource identifier) consisting of a back-end, such as “usb”, and parameters, like “/dev/usb/lp1”. For example, the full URI could be parallel:/dev/lp0 (printer connected to the first parallel port) or usb:/dev/usb/lp1 (first detected printer connected to the USB port). 12.4.2.�Network Printers A network printer can support various protocols, some of them even concurrently. Although most of the supported protocols are standardized, some manufacturers expand (modify) the standard because they test systems that have not implemented the standard correctly or because they want to provide certain functions that are not available in the standard. Manufacturers then provide drivers for only a few operating systems, eliminating difficulties with those systems. Unfortunately, Linux drivers are rarely provided. The current situation is such that you cannot act on the assumption that every protocol works smoothly in Linux. Therefore, you may have to experiment with various options to achieve a functional configuration. CUPS supports the socket, LPD, IPP, and smb protocols. Here is some detailed information about these protocols: socket Socket refers to a connection in which the data is sent to an Internet socket without first performing a data handshake. Some of the socket port numbers that are commonly used are 9100 or 35. An example device URI is socket://host-printer:9100/. LPD (line printer daemon) The proven LPD protocol is described in RFC�1179. Under this protocol, some job-related data, such as the ID of the printer queue, is sent before the actual print data is sent. Therefore, a printer queue must be specified when configuring the LPD protocol for the data transmission. The implementations of diverse printer manufacturers are flexible enough to accept any name as printer queue. If necessary, the printer manual should indicate what name to use. LPT, LPT1, LP1, or similar names are often used. Of course, an LPD queue can also be configured on a different Linux or Unix host in the CUPS system. The port number for an LPD service is 515. An example device URI is lpd://host-printer/LPT1. IPP (Internet printing protocol) IPP is a relatively new (1999) protocol based on the HTTP protocol. With IPP, more job-related data is transmitted than in the other protocols. CUPS uses IPP for internal data transmission. This is the preferred protocol for a forwarding queue between two CUPS servers. The name of the print queue is necessary to configure IPP correctly. The port number for IPP is 631. Example device URIs are ipp://host-printer/ps or ipp://host-cupsserver/printers/ps. SMB (Windows share) CUPS also supports printing on printers connected to Windows shares. The protocol used for this purpose is SMB. SMB uses the port numbers 137, 138, and 139. Example for a device URI: smb://user:password@workgroup/server/printer or: smb://user:password@host/printer or: smb://server/printer The protocol supported by the printer must be determined prior to the configuration. If the manufacturer does not provide the needed information, the command nmap (nmap package) can be used to guess the protocol. nmap checks a host for open ports. For example:
nmap -p 35,137-139,515,631,9100-10000 printerIP 12.4.3.�Configuration Tasks 12.4.3.1.�Configuring Network Printers Network printers should be configured with YaST. YaST facilitates the configuration and is best equipped to handle the security restrictions in CUPS (see 12.5.2. “Administrator for CUPS Web Front-End”). 12.4.3.2.�Configuring CUPS in the Network Using YaST For guidelines for installation of CUPS in the network, read the article CUPS in a Nutshell in the Support Database at http://portal.suse.com. For configuring the queues for the printers belonging to the CUPS server on the print server, you have the following options: Network Printers or Print Server Box via TCP socket with local filtering (default) or without local filtering via LPD protocol with local filtering (default) or without local filtering via IPP protocol with local filtering (default) or without local filtering Queue on LPD Server (always via LPD protocol) without local filtering (default) or with local filtering Queue on IPP Server (always via IPP protocol) without local filtering (default) or with local filtering Queue on SMB Server (always via SMB protocol) with local filtering (default) or without local filtering Queue on IPX Server (always via Novell IPX) with local filtering (default) or without local filtering Queue via Other URI with local filtering (default) or without local filtering When permitting access to the queues for the client computers, the default settings are usually sufficient. If you are not sure, refer to the portal article mentioned above. To activate the transmission of browsing information to the client computer, start YaST, select ‘Printer’ and click ‘Change...’ then ‘Advanced’ and select ‘CUPS server settings’. Next, go to ‘Browse Addresses’, click ‘Add’, and enter the broadcast IP address of the network or @LOCAL. Conclude the configuration by clicking ‘OK’, ‘Next’, ‘Accept’, then ‘Finish’ 12.4.3.3.�Configuring with Command-Line Tools Alternatively, CUPS can be configured with command-line tools. If the preparatory work has been done (if you know the PPD file and the name of the device), the following steps are necessary:
lpadmin -p
-v \
-P -E
Do not use -E as the first option. For all CUPS commands, -E as the first argument implies the use of an encrypted connection. To enable the printer, -E must be used as shown in the following example:
lpadmin -p ps -v parallel:/dev/lp0 -P \
/usr/share/cups/model/Postscript.ppd.gz -E
Example for a network printer:
lpadmin -p ps -v socket://192.168.1.0:9100/ -P \
/usr/share/cups/model/Postscript-level1.ppd.gz -E
12.4.3.4.�Modifying Options YaST allows certain options to be activated by default during the installation. These options can be modified for every print job (depending on the print tool used) or specified later, for example, with YaST. Using command-line tools, this can be done as follows: First, list all options:
lpoptions -p -l Example:
Resolution/Output Resolution: 150dpi *300dpi 600dpi The activated default option is evident from the preceding asterisk (*). Change the option with lpadmin:
lpadmin -p -o Resolution=600dpi Check the new setting:
lpoptions -p -l
Resolution/Output Resolution: 150dpi 300dpi *600dpi SUSE LINUX 9.2 12.3.�Installing the Software 12.5.�Special Features in SUSE LINUX