1
August
2025
Installing network printers in Linux - part 1: types of printer connections, printing via AppSocket
15:03

Installing network printers in Linux - part 1: types of printer connections, printing via AppSocket

1 August 2025 15:03

At work, there are several networked printers and multifunction devices (MFPs) connected to a local area network (LAN). They can be printed from a computer running the Linux operating system. One day the printing jobs stopped going out and the printer stopped printing. I had to study the question of how best to install a network printer in the Linux operating system.

Introduction

There are many instructions for setting up printers in CUPS. But they pay little attention to distinguishing network printing technologies. In particular, there are lower-level technologies (AppSocket and IPP/IPPS), and newer ones, including ZeroConf and Driverless printing. In this article I wanted to take a closer look at options for connecting network printers in Linux.

Network printing classification:

For Linux:

- By using drivers:

  • printing with drivers (for older devices),
  • print without drivers (for modern devices).

    - According to the need for configuration (from greatest to least requirements):

    • printing technologies that require manual configuration (administration) of printers:
      • AppSocket (JetDirect) - direct printing to a printer, requires connection configuration.
      • IPP, IPPS - in their pure form they require manual configuration, because they do not use Avahi/DNS-SD (Bonjour) or IPP Everywhere auto discovery. Together with Bobjour, IPPS does not require configuration.
    • Print technology without configuration (ZeroConf) in Linux:

For Apple, printing technology with the "Zero Conf" function without configuration:
*AirPrint(same as "Bonjour") - for Apple iOS: Mac, iPad, iPhone, iPod.

For Android, printing technology with function without configuration (ZeroConf):
*printing systems from the MFP manufacturer* closed source (Wi-Fi networks, Wi-Fi Direct, or built-in Wi-Fi hotspot),
Mopria**(technology from Mopria alliance printer manufacturers, the application on Google Play is not available in the Russian Federation).

1. Search for network printers on the local network

1.1 Finding network printers using CUPS

http://localhost:631/admin - button "Add a printer".

Details:

Cups implements a search for printers in the CUPS web interface. http://localhost:631/ -> Administration ->Add a printer:

cups-search1

On the next screen, in the * Discovered network printers column, a list of printers found on the local network will be displayed.

cups-search2

Select line -> button Continue(the button is located at the bottom of the screen or behind the screen - scroll down the web page).

The screen displays a connection string mentioning one of two network printing protocols: IPPS:// or DNSSD://.

cups-search3

If the printer is fairly new and supports the driverless printing mode and the option with the driverless prefix is selected in the list, then after pressing Continue an option will be offered IPP Everywhere- printing without drivers (see section 2.2 - printing without drivers in IPP Everywhere).

1.2 How to find network printers from the command line using lpinfo

If printers on the network can advertise themselves using Bonjour(a combination of multicast DNS (mDNS) and DNS service discovery (DNS-SD) standards), they can be found with the command "lpinfo -v".

lpinfo -v

network lpd
file cups-brf:/
network http
network socket
network beh
network ipp
network smb
network https
serial serial:/dev/ttyS0?baud=115200
network ipps
direct hp
direct hpfax
network dnssd://Kyocera%20ECOSYS%20M2540dn._ipp._tcp.local/?uuid=4509a320-0056-0101-003e-0025074f9312
network ipps://Pantum%20BM5100ADN%20Series%204AF471._ipps._tcp.local/

The last two entries correspond to network printers. The Kyocera printer announced itself via DNSSD - a serverless DNS replacement (broadcast packets). The second Pantum printer announced itself on the network in a different way - IPPS Multicast Discovery.

  • model Pantum BP5100DW. The user manual says that it is compatible with Linux (Ubuntu 14.04/16.04/18.04 (32/64 bit); Debian 10.0;RedHat 8.0.0; Astra Linux Special Edition V1.6; CentOS 7 (32/64 bit).

1.3 Finding IPP-enabled network printers using the Avahi service

sudo apt install avahi-utils
sudo service avahi-daemon start

avahi-browse -rt _ipp._tcp #look only for _ipp._tcp

avahi-browse -ra #search for all printers (long)

transcript:

  • port 80 - printer port with IPP support (without S)
  • port 443 - printer port with IPPS support
  • port 631 - printer port with IPPS support

1.4 Graphical way to search for network printers using the Printers snap-in

Linux Mint has a snap-in in Start - Administration
*Printers(package and command system-config-printer)

The installation includes packages:

sudo apt install system-config-printer system-config-printer-common system-config-printer-udev

sudo apt install python3 python3-cups python-cupshelpers python3-dbus

The Printers snap-in is available for the following desktops:

  • ubuntu-desktop-minimal,
  • ubuntu-desktop,
  • kubuntu-desktop,
  • kubuntu-full,
  • xubuntu-desktop,
  • lubuntu-desktop,
  • ubuntustudio-desktop,
  • ubuntukylin-desktop,
  • ubuntu-mate-core,
  • ubuntu-mate-desktop,
  • ubuntu-budgie-desktop,
  • ubuntu-budgie-desktop-raspi

    Starting a search for network printers:

    system-config-printer

When opening system-config-printer network printers are searched and their IP addresses and host names are displayed.

1.5 Searching for network printers using packet sniffer WireShark 4.2.0 and higher

Network printers and routers send Bonjour mDNS packets (RFC 6762):

mdns

Launching the standard version of WireShark 3.x.x (from the repository)

sudo wireshark

Capture and save to pcapng file. Then sudo chmod 644 *.pcapng

Installing Wireshark version 4.4.8 for packet analysis:

flatpak install flathub org.wireshark.Wireshark

Launching version 4.4.8:

flatpak run org.wireshark.Wireshark

Multicast filter, mDNS ipp protocol, excluding packets from your PC:
(eth.dst[0] & 1) && ip.dst>=224.0.0.0 && _ws.col.info matches "(?i)_ipp" && _ws.col.info matches "(?i)0x0000" && ! ip.addr==192.168.11.100

Where 192.168.11.100 replace with the IP address of this computer (in the command output ip addr).

The result of searching for mDNS packages can be seen in the screenshot below:
mdns2

As you can see, multicast DNS or mDNS uses the port 5353. So the WireShark filter for finding Bonjour packets can be greatly simplified.

1.6 Cups-browsed service

The cups-browsed helper service automatically finds network printers on the local network and creates print queues in CUPS. Thus, there is no need to install MFPs and printers if they are located cups-browsed when the operating system starts. Discover printers using a service cups-browsed it may be more convenient than manually installing the printer, but it slows down the print start and increases the load on the processor.

For details on using cups-browsed in Linux, see paragraph 3.1.3 of the second part of the article.

The cups-browsed service is built into the Russian Linux Green OS (a clone of Linux Mint).

2.CUPS

Administration of printers for any of the connection methods is carried out on the panel CUPS - Common UNIX Printing System.

2.1 Installing the CUPS service

sudo apt install cups

Starting the CUPS service through systemctl, the main management tool for the SystemD init system:

sudo systemctl start cups

Check:

systemctl status cups

Allow startup when computer boots:

sudo systemctl enable cups

To avoid the username and password entry window being displayed when opening the web interface:

sudo adduser your_username lpadmin

2.2 Administering Printers Using the CUPS Service

By default, CUPS administration is performed via the web interface to the address of the local computer only, port 631:
http://localhost:631/.

In the article I consider setting up a computer as client for printing, that is, a workstation from which printing is carried out directly to a network printer. If you want to turn your Linux computer into a print server, when adding a printer in the CUPS system, check the box "Allow sharing of this printer".

3. Methods for installing a printer in Linux - with or without a driver

3.1. Methods for installing a printer with a driver

3.1.1 AppSocket printing protocol (JetPrint)

The protocol was proposed by HP (Hewlett Packard), located in Palo Alto, California, USA. When using AppSocket, commands are sent to the printer using the Socket API through the printer's network port:9100/TCP. The printer status is monitored via the port 9101/UDP(optional). Descriptions of the formatting of document pages are made in the PostScript language (abbreviated PS) in the driver on the PC side. That is, the data goes to the printer in prepared form.

Benefits:

  • The printer may be "stupid" or outdated.
  • easy to install
  • one of the most commonly used network protocols for printing to printers
  • fast printing. operates at a low level. Because of this, printing using Socket is called RAW printing.
  • The URI address is as simple as possible, it contains only the IP address of the printer on the local network and port 9100.

Disadvantages:

  • no security. (not suitable for large organizations where printers may be attacked when they start printing a lot of blank pages or garbage, and data can be intercepted while being transmitted over the local network).
  • does not allow printing to the printer from the Internet, since ports 9100 and 9001 are blocked on the firewall, and it is not safe to open them outside.
  • does not support mode without setting Zero Conf for Apple Macintosh, etc. Because you need to know the static IP address of the printer.
  • The printer's IP address must be fixed. DHCP cannot be used.

Connection string:
socket://ip-address

Finding and checking the printer's IP address

  1. First, find out the printer's IP address (you can print its "configuration page") or go to the IPv4 address display menu.
  2. You can check for the presence of the APPSocket protocol with the nmap command, which will check if port 9001 is open:

sudo apt update && sudo apt install nmap -y
nmap 192.168.1.123 -p 9100

sudo nmap -PU 192.168.1.123 -p 9001


, where 192.168.1.123 is replaced with the IP address of the printer on the local network.

How to set up a printer using the AppSocket protocol

Before installing the printer, you should download and install the driver from the website of the printer or MFP manufacturer. The driver can be a package file with a DEB extension for installation using the "Package Installer" utility or the command sudo dpkg -i имя_файла.deb or an archive with files, folders and an installation script in Shell - with the .sh extension. If the files are in an archive, you need to extract them first, then install sudo sh filename.sh. Be careful and download the driver distribution only from the official website of the device manufacturer! The address of the manufacturer's official website is usually indicated in the printer user manual.

  1. On your personal computer running Linux, go to the CUPS settings - in your web browser you need to enter in the address bar: http://localhost:631/.
  2. On the CUPS web page, select the menu item Administration-Add a printer
  3. Then "other network printers"-"AppSocket/HP JetDirect", Click Continue
  4. socket://192.168.1.123- replace with the real IP address of the printer from steps 1 and 2. Click Continue
  5. fill in the field "Name"- no spaces. For example. Pantum. Click Continue
  6. In the "create" field, specify the manufacturer, for example Pantum. Click Continue
  7. please indicate printer model indicated on the back of the MFP (printer) or on the packaging. For example, Pantum BM5100 Series PS (en). Click "Add printer".

Continued - part 2
Continued - part 3
*The end - part 4



Related publications