System Administration Guide

How To Add A Network Printer Using LP Commands


Note -

This describes the steps necessary to setup a network printer using the SunSoft 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

    See the terms described in "Adding a Network Printer" for more information.

  3. Define the printer name, the device, the printer type and content type by using the lpadmin command.

    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 -i /usr/lib/lp/model/netstandard 
      

      The interface script that is supplied with the SunSoft 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. See "Adding a Network Printer" for more information.

      -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. See "Adding a Network Printer" for more information.

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


      # lpadmin -p printer-name -I content-type -T printer-type
      
  4. Add filters to the print server by using the lpfilter command.


    #	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 the printer is correctly configured by using the lpstat command.


    #	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. See "Setting Up a Print Client".

  8. Optional tasks to complete.

    There are several optional tasks you may want to complete when setting up a printer. See "Setting Up Printing Task Map" for pointers to the remaining tasks.

Example--Adding a Network Printer Using LP Commands

The commands in this example must be executed on the print server. The following information is used in the example and may change depending on your situation: