System Administration Guide: Advanced Administration

How to Add A Network Printer With LP Commands

This procedure describes the steps necessary to setup a network printer using the network printer support software. The use of this software is intended for those 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 is equivalent to adding any node to the network.

  2. Collect the information required to configure a network printer.

    • Printer name

    • Printer server

    • Network printer access name

    • Protocol

    • Timeout

    For more information, see the terms described in Adding a Network Printer.

  3. Define the printer name, the device, the printer type and content type.

    1. Define the printer name and the port device the printer will use.


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

      The device to use is /dev/null.

    2. Identify the interface script the printer will use.


      # lpadmin -p printer-name -m netstandard 
      

      The interface script that is supplied with the network printer support software is /usr/lib/lp/model/netstandard.

    3. 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 it 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.  

    4. Specify the file content types of the printer and the printer type.


      # lpadmin -p printer-name -I content-type -T printer-type
      

      For more information, see lpadmin(1M).

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


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


    # lpstat -p printer-name
    
  7. 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.

  8. Optional tasks to complete.

    There are several optional tasks you might want to complete when setting up a printer. For pointers to the remaining tasks, see Setting Up Printing (Task Map).

Example—Adding A Network Printer With LP Commands

The commands in this example must be executed on the print server. The following information is used as an example. The information 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 directly, and the printer type.

  5. Adds print filters to the print server.

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

  7. Adds a description for the printer.

  8. Verifies that the printer is ready.