System Administration Guide: Solaris Printing

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

This procedure describes how to add a new network printer with the expanded printer support that is available in this release. There are two examples that follow this procedure. The first example shows you how to add a new network printer with PPD files by using lp commands. The second example shows you how to add a new network printer without PPD files by using lp commands.

The following steps are necessary to set up a network 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.

For overview information about adding a new network printer or modifying an existing network printer with PPD files, see What's New in Printing?.

  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 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 Printers.

  3. 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 Use LP Print Commands to Add a Print Queue With localhost Specified as the Host Name.

      You can use the -v option to specify a device-uri. The protocol enables you to access remote printers. For more information, see What is a Device URI?.

    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 network 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 9, Administering Printers by Using the PPD File Management Utility (Tasks).


      For more information, see lpadmin(1M).

    4. Specify the printer description.


      # lpadmin -p printer-name -D  "printer-description"
      
  4. 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.

  5. (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
    
  6. Enable the printer to accept print requests and to print those requests.


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


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

    Now that the printer has been added, create access to the printer for the clients. For more information, see Setting Up a Print Client. For information about how to define a print client by using a naming service, see Printing Support in the naming service Switch.

  9. 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 Setting Up Solaris Printing Services (Task Map). For information about how to define print clients by using the naming service, see Printing Support in the naming service Switch.


Example 4–9 Adding a New Network-Attached Printer With PPD Files by Using LP Print Service Commands

This example shows how to add a new network printer with PPD files. The -n option to the lpadmin command enables you to add a new print queue by specifying PPD files. The commands 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 4–10 Adding a New Network-Attached Printer Without PPD Files by Using LP Print Service Commands

This example shows how to add a new network printer without PPD files. Thse commands must be executed on the print server.

The following information is used as an example:


# 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