Setting Up Network‐Attached Printers by Using LP Print Commands
The following table describes each printer attribute to help you determine the information
that is needed to set up a network‐attached printer by using the lpadmin
command.
Printer Definition |
LP Command Option |
Description |
Example |
Default Setting |
Required or Optional? |
Printer Name |
-p |
Name of printer |
laser1 |
N/A |
Required to install an
attached or network printer and to add access to a printer |
Print server |
|
Name of print
server |
venus |
Use localhost for Printer Server attribute check box selected by default |
Required to install an attached or network
printer and to add access to a printer — This field is filled
in by the tool |
Description |
-D |
User defined string |
laser printer near breakroom |
N/A |
Optional |
Printer Type |
-T |
Type of printer |
unknown |
PostScript |
Required to install an attached
printer or a network printer without PPD files |
File Content Type |
-I |
Content to be printed |
any |
PostScript |
Required to install
an attached printer or a network printer without PPD files |
PPD file name |
-n |
Full path
and file name of the PPD file including the .ppd extension |
$path/myprinter.ppd |
N/A |
Optional |
Destination |
-o |
Destination name
for the network printer |
-o dest=access-name:port |
N/A |
Required to install a network printer |
Protocol |
-o |
Protocol used to
communicate with the printer |
-o protocol=tcp |
BSD |
Required to install a network printer |
Fault Notification |
-A |
Specifies how
to notify user of errors |
-A mail |
Write to superuser |
Optional |
Default Printer |
-d |
Identifies the default printer |
N/A |
N/A |
Optional |
Banner Page control |
-o |
Select
whether to print banner |
-o banner=never |
-o banner=optional |
Optional |
How 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?.
- 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.
- Collect the information that is required to configure a new network printer with
PPD files.
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.
- 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.
- 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?.
- 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.
- 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).
- Specify the printer description.
# lpadmin -p printer-name -D "printer-description"
- 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.
- (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
- Enable the printer to accept print requests and to print those requests.
# accept printer-name
# enable printer-name
- Verify that the printer is correctly configured.
# lpstat -p printer-name
- 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.
- 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.
Printer name : luna1
Device: /dev/null
Interface: /usr/lib/lp/model/netstandard_foomatic
Network printer access name: nimquat:9100
Protocol: tcp
Timeout: 5
File content type: postscript
PPD file: /path/ppdfile
# lpadmin -p luna1 -v /dev/null (1)
# lpadmin -p luna1 -m netstandard_foomatic (2)
# lpadmin -p luna1 -o dest=nimquat:9100 -o protocol=tcp -o timeout=5 (3)
# lpadmin -p luna1 -I postscript (4)
# lpadmin -p luna1 -n /path/ppdfile (5)
# lpadmin -p luna1 -D "Second floor color printer"(6)
# cd /etc/lp/fd
# for filterin *.fd;do
> name =`basename $ filter .fd`
> lpfilter -f $ name -F $ filter
> done (7)
# accept luna1
destination "luna1" now accepting requests
# enable luna1 (8)
printer "luna1" now enabled
# lpstat -p luna1 (9)
printer luna1 is idle. enabled since Mon Apr 19 15:31:15 2004. available.
Defines printer name and sets the device to /dev/null
Defines the interface script for network printers
Sets the destination, protocol, and timeout
Specifies the file content types to which the printer can print to directly
Specifies the PPD file to use
Adds a description for the printer
Adds print filters to the print server
Accepts print requests for the printer and enables the printer
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:
Printer name: luna1
Device: /dev/null
Interface: /usr/lib/lp/model/netstandard
Network printer access name: nimquat:9100
Protocol: tcp
Timeout: 5
File content type: postscript
Printer type: PS
# 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.
Defines printer name and sets the device to /dev/null
Defines the interface script for network printers
Sets the destination, protocol, and timeout
Specifies the file content type to which the printer can print directly, and the printer type
Adds a description for the printer
Adds print filters to the print server
Accepts print requests for the printer and enables the printer
Verifies that the printer is ready for printing
How to Set Up a Remote Printer That is Connected to a Solaris Print Server by Using IPP
- Become superuser or assume an equivalent role.
- Set up a remote printer by using one of the following methods:
- To use the lpadmin command, type the following command:
# lpadmin -p printer -s ipp://printer-ip-address/printers/printer-name
- To use the lpset command, type the following command:
# lpset -a printer-uri-supported=ipp://printer-ip-address/printers/printer-name
The -a option of the lpset command accepts key/value pairs. In the preceding
output, the key that is specified is printer-uri-supported, with the value being ipp://printer-ip-address/printers/printer-name.
Typically, you would not configure this value to refer directly to a
printer, but rather a print queue on a print server.
- (Optional) To determine the URI you have supplied, type the following command:
$ lpstat -p ipp://printer-ip-address/printers/printer-name
When you use the lpstat command and specify the URI as the destination,
the local printing configuration is bypassed, connecting you directly to the network‐attached printer or
the remote print server.