System Administration Guide: Printing

ProcedureHow to Add a New Network-Attached Printer by Using LP Print Commands

This procedure describes how to add a new network-attached printer with the expanded printer support that enables you to associate a PPD file with a printer during its configuration. There are two examples that follow this procedure. The first example illustrates how to add a new network-attached printer with PPD files by using lp commands. The second example shows how to add a new network printer without PPD files by using lp commands.

The following steps are required to set up a network-attached printer by using the network printer support software. The use of this software is intended for printers that do not come with vendor-supplied software.

  1. Connect the printer to the network, and turn on the power to the printer.

    Consult the printer vendor's installation documentation for information about the hardware switches and cabling requirements. Get an IP address and select a name for the printer node. This step is equivalent to adding any node to the network.

  2. Collect the information that is required to configure a new network-attached printer with PPD files.

    • Printer name and port device

    • Network printer access name

    • Protocol

    • Timeout

    • File content type

    • PPD file

    To determine the PPD file, first define the printer make, model, and driver that the printer will use.

    For more information, see the terms that are described in Setting Up Network-Attached Printers by Using LP Print Commands.

  3. On the print server, log in and become superuser or assume an equivalent role.

  4. Define the printer name, port device, file content type, and PPD file that the printer will use. When using PPD files, the file content type is usually PostScript.

    1. Specify the printer name and the port device that the printer will use.


      # lpadmin -p printer-name -v /dev/null
      

      The device to use is /dev/null.

      You can use the -s option with the lpadmin command to specify the print service host name as localhost. For more information, see How to Add a Print Queue With localhost Specified as the Host Name (LP Print Commands).

      You can use the -v option to specify a device-uri. The protocol enables you to access remote printers. For more information, see Using Printing Protocols in the Oracle Solaris Release.

    2. Specify the interface script that the printer will use.


      # lpadmin -p printer-name -m netstandard_foomatic 
      

      The interface script that is supplied with the support software for a network-attached printer is /usr/lib/lp/model/netstandard_foomatic.

    3. Specify the file content type and PPD file that the printer will use.

      When using PPD files, the file content type is usually PostScript.


      # lpadmin -p printer-name -I content-type -n 
      /path/ppdfile
      

      The PPD file that you specify is located in the /path directory.


      Note –

      If /path is not a PPD file repository on the system, then a copy of PPD file is placed in the user label directory in the user PPD file repository. For more information, see Chapter 11, Administering Printers by Using the PPD File Management Utility (Tasks).


      For more information, see lpadmin(1M) man page.

    4. Specify the printer description.


      # lpadmin -p printer-name -D  "printer-description"
      
  5. Set the printer destination, protocol, and timeout values.


    # lpadmin -p printer-name -o dest=access-name:port -o protocol=protocol
    -o timeout=value
    
    -p printer-name

    Specifies the network printer name.

    -o dest=access-name:port

    Sets the printer destination to the network printer access name and a designated printer vendor port, if the port is defined in the printer vendor documentation.

    -o protocol=protocol

    Sets the over-the-wire protocol used to communicate with the printer. Both BSD and raw TCP are supported.

    -o timeout=value

    Sets a retry timeout value that represents a number of seconds to wait between attempting connections to the printer.

  6. (Optional) Add filters to the print server.


    # cd /etc/lp/fd
    # for filter in *.fd;do
        > name=`basename $ filter .fd`
        > lpfilter -f $name -F $ filter
        > done
    
  7. Enable the printer to accept print requests and to print those requests.


    # accept printer-name
    # enable printer-name
    
  8. Verify that the printer is correctly configured.


    # lpstat -p printer-name
    
  9. Add client access to the new printer.

    After the printer has been configured , create access to the printer for the print clients. For more information, see Adding Printer Access by Using LP Print Commands. For information about how to define a print client by using a naming service, see Printing Support in the Naming Service Switch.

  10. Complete any optional tasks.

    There are several optional tasks that you might want to complete when setting up a printer. For pointers to the remaining tasks, see Configuring the Internet Printing Protocol (Task Map). For information about how to define print clients by using the naming service, see Printing Support in the Naming Service Switch.


Example 5–9 Adding a New Network-Attached Printer by Specifying a PPD File

This example shows how to add a new network-attached printer with PPD files. The -n option of the lpadmin command enables you to add a new print queue by specifying a PPD file. The commands that are used in this example must be executed on the print server. The following information is used as an example only. The information that you provide will vary.

  1. Defines printer name and sets the device to /dev/null

  2. Defines the interface script for network printers

  3. Sets the destination, protocol, and timeout

  4. Specifies the file content types to which the printer can print to directly

  5. Specifies the PPD file to use

  6. Adds a description for the printer

  7. Adds print filters to the print server

  8. Accepts print requests for the printer and enables the printer

  9. Verifies that the printer is ready for printing



Example 5–10 Adding a New Network-Attached Printer Without Specifying a PPD File

This example shows how to add a new network-attached printer without specifying a PPD file. These commands must be executed on the print server. The following information is used for example purposes only.


# lpadmin -p luna1 -v /dev/null (1)
# lpadmin -p luna1 -m netstandard (2)
# lpadmin -p luna1 -o dest=nimquat:9100 -o protocol=tcp 
-o timeout=5 (3)
# lpadmin -p luna1 -I postscript -T PS (4)
# lpadmin -p luna1 -D "Room 1954 ps" (5)
# cd /etc/lp/fd
# for filter in *.fd;do	
	   > name =`basename $ filter .fd`	
	   > lpfilter -f $ name -F $ filter	
	   > done (6)
# accept luna1
	destination "luna1" now accepting requests
# enable luna1 (7)
printer "luna1" now enabled 
# lpstat -p luna1 (8)
printer luna1 is idle.enabled since Feb 28 11:21 2003.available.
  1. Defines printer name and sets the device to /dev/null

  2. Defines the interface script for network printers

  3. Sets the destination, protocol, and timeout

  4. Specifies the file content type to which the printer can print directly, and the printer type

  5. Adds a description for the printer

  6. Adds print filters to the print server

  7. Accepts print requests for the printer and enables the printer

  8. Verifies that the printer is ready for printing