A network printer is a hardware printing device that is connected directly to a network. A network printer has its own system name and IP address.
CUPS automatically discovers printers that are identified in the same subnet. Network printers that are not in the same subnet have to be added manually by the system administrator. You can configure a network printer by using the lpadmin command.
Consult the printer vendor's installation documentation for information about hardware switches and cabling requirements.
# ping ip-address-of-network-printer
# lpinfo --make-and-model printer manufacturer name
For example, to list the Xerox printers:
# lpinfo --make-and-model Xerox -m
For more information, see How to List the Available Drivers and Devices.
# lpadmin -p printer-name -E -v socket://ip-address-of-network-printer \ -m printer-make-and-model
Specifies the name of the printer to add.
Enables the destination and accepts jobs.
Sets the device-uri attribute of the print queue.
Sets the PPD file for the printer from the model directory or by using one of the driver interfaces.
For information, see the lpadmin(8) man page.
# lpstat -l -p printer-name
The following example shows how to add the Xerox printer luna that is on a different subnet with IP address 10.178.236.21:
# ping 10.178.236.21 10.178.236.21 is alive # lpinfo --make-and-model Xerox -m foomatic:Xerox-2700_XES-xes.ppd Xerox 2700 XES Foomatic/xes foomatic:Xerox-3700_XES-xes.ppd Xerox 3700 XES Foomatic/xes foomatic:Xerox-4045_XES-xes.ppd Xerox 4045 XES Foomatic/xes foomatic:Xerox-Phaser_5500DN-Postscript.ppd Xerox Phaser 5500DN Foomatic/Postscript\ gutenprint.5.2://xerox-able_1406/expert # lpadmin -p luna -E -v socket://10.178.236.21 \ -m foomatic:Xerox-Phaser_5500DN-Postscript.ppd # lpstat -l -p luna printer luna is idle. enabled since June 25, 2012 12:13:05 PM IST printer luna is idle. enabled since September 29, 2011 05:20:57 PM BST Form mounted: Content types: any Printer types: unknown Description: luna Alerts: none Location: Connection: direct On fault: no alert After fault: continue Users allowed: (all) Forms allowed: (none) Banner required Charset sets: (none) Default pitch: Default page size: Default port settings:
The lpinfo command lists the available devices and drivers known to the CUPS server.
# lpinfo -m
# lpinfo -v
To list all Xerox printers:
# lpinfo --make-and-model Xerox -m foomatic:Xerox-2700_XES-xes.ppd Xerox 2700 XES Foomatic/xes foomatic:Xerox-3700_XES-xes.ppd Xerox 3700 XES Foomatic/xes foomatic:Xerox-4045_XES-xes.ppd Xerox 4045 XES Foomatic/xes gutenprint.5.2://xerox-able_1406/expert Xerox Able 1406 - CUPS+Gutenprint v5.2.4 gutenprint.5.2://xerox-able_1406/simple Xerox Able 1406 - CUPS+Gutenprint v5.2.4 Simplified