Cups browsing

From Finninday
Jump to: navigation, search

I'm trying to understand the basics of cups configuration for printing.

I started this adventure in cups 1.4. At that time there was a cups browse protocol, but it has since been deprecated and it no longer supported.

I have a print server that sees three printers and can print to them locally. It seems like client cups instances should be able to easily discover the print server as they are on the same network, but when I use cups admin to find new printers or add a printer, I have to manually construct the proper URL to describe the network shared printer. Surely it can be easier than that.

I'm now at cups 1.7, it looks like the browsing mechanism is bonjour (

The config file of interest is /etc/cups/cups-browsed.conf

And the service of interest is cups-browsed

server and client configuration

The cups documentation says that it is. (

My cups server is running cups 1.4.4 My cups clients are running 1.5.4,

It looks like the following configuration directives are of interest for the server:

  • Allow

The Allow directive specifies a hostname, IP address, or network that is allowed access to the server. Allow directives are cummulative, so multiple Allow directives can be used to allow access for multiple hosts or networks.

  • BrowseAddress

The BrowseAddress directive specifies an address to send browsing information to. Multiple BrowseAddress directives can be specified to send browsing information to different networks or systems.

The @LOCAL name will broadcast printer information to all local interfaces. The @IF(name) name will broadcast to the named interface.

There is no default browse address.

  • BrowseAllow

The BrowseAllow directive specifies a system or network to accept browse packets from. The default is to accept browse packets from all hosts.

Host and domain name matching require that you enable the HostNameLookups directive.

IP address matching supports exact matches, partial addresses that match networks using netmasks of,, and, or network addresses using the specified netmask or bit count. The /mm notation specifies a CIDR netmask, a shown in Table 1.

The @LOCAL name will allow browse data from all local interfaces. The @IF(name) name will allow browse data from the named interface. In both cases, CUPS only allows data from the network that the interface(s) are configured for - data arriving on the interface from a foreign network will not be allowed.

  • Browsing

The Browsing directive controls whether or not network printer browsing is enabled. The default setting is Yes.

This directive does not enable sharing of local printers by itself; you must also use the BrowseAddress or BrowseProtocols directives to advertise local printers to other systems.

  • Listen

The Listen directive specifies a network address and port to listen for connections. Multiple Listen directives can be provided to listen on multiple addresses.

The Listen directive is similar to the Port directive but allows you to restrict access to specific interfaces or networks.

Error message hint

"FirewallD is not running. Network printer detection needs services mdns, ipp, ipp-client and samba-client enabled on firewall."

firewall configuration

I'm allowing port 631 tcp and udp on my local subnet

network configuration

I found that my broadcast address was not consistent across the subnet and after fixing that, I was able to see broadcasts from the server on the client, but nothing else. No response.

hey, they're using snmp to talk to printers

I didn't notice anything in the getting started guide about configuring snmp, but it seems to be used for the discovery of printers from the cups server. That's cool, but I'm more interested in the discovery of printers from the cups client to the cups server.

On a different subnet (at work), I see that auto-discovery works just fine. When I dump the network during discovery, I see that it is using snmp:

[root@etli]# tcpdump -p -i em1 port snmp; # client is
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on em1, link-type EN10MB (Ethernet), capture size 65535 bytes
09:09:05.305339 IP >  GetRequest(28)
09:09:05.306093 IP >  GetResponse(37)
09:09:05.311978 IP >  GetResponse(37)
09:09:05.321970 IP >  GetResponse(28)  noSuchName@1
09:09:05.322647 IP >  GetRequest(28)
09:09:05.322807 IP >  GetRequest(32)  E:2699.
09:09:05.322815 IP >  GetRequest(33)  E:2699.
09:09:05.322820 IP >  GetRequest(25)  system.sysLocation.0
09:09:05.322825 IP >  GetRequest(30)  E:641.
09:09:05.323369 IP >  GetResponse(37)"FS-C5015N"
09:09:05.323388 IP >  GetResponse(148)  E:2699."ID:FS-C5015N;MFG:Kyocera;CMD:PCLXL,PostScript Emulation,PCL5C,PJL;MDL:FS-C5015N;CLS:PRINTER;DES:Kyocera FS-C5015N;"
09:09:05.323409 IP >  GetRequest(33)  E:674.10898.
09:09:05.323418 IP >  GetRequest(30)  E:641.
09:09:05.323423 IP >  GetRequest(31)  E:367.
09:09:05.323629 IP >  GetResponse(33)  E:2699.""
09:09:05.323865 IP >  GetRequest(30)  E:
09:09:05.323874 IP >  GetRequest(30)  E:hp.
09:09:05.323996 IP >  GetResponse(25)  system.sysLocation.0=""
09:09:05.324004 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.324018 IP >  GetRequest(28)
09:09:05.324026 IP >  GetRequest(32)  E:2699.
09:09:05.324032 IP >  GetRequest(33)  E:2699.
09:09:05.324037 IP >  GetRequest(25)  system.sysLocation.0
09:09:05.324042 IP >  GetRequest(30)  E:641.
09:09:05.324046 IP >  GetRequest(33)  E:674.10898.
09:09:05.324052 IP >  GetRequest(30)  E:641.
09:09:05.324058 IP >  GetRequest(31)  E:367.
09:09:05.324063 IP >  GetRequest(30)  E:
09:09:05.324081 IP >  GetRequest(30)  E:hp.
09:09:05.324272 IP >  GetResponse(33)  noSuchName@1 E:674.10898.
09:09:05.324544 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.324559 IP >  GetResponse(31)  noSuchName@1 E:367.
09:09:05.324563 IP >  GetResponse(30)  noSuchName@1 E:
09:09:05.324803 IP >  GetResponse(30)  noSuchName@1 E:hp.
09:09:05.325152 IP >  GetRequest(28)
09:09:05.325158 IP >  GetRequest(32)  E:2699.
09:09:05.325160 IP >  GetRequest(33)  E:2699.
09:09:05.325162 IP >  GetRequest(25)  system.sysLocation.0
09:09:05.325164 IP >  GetRequest(30)  E:641.
09:09:05.325165 IP >  GetRequest(33)  E:674.10898.
09:09:05.330481 IP >  GetResponse(53)"KONICA MINOLTA bizhub 600"
09:09:05.335709 IP >  GetResponse(32)  noSuchName@1 E:2699.
09:09:05.342764 IP >  GetResponse(33)  noSuchName@1 E:2699.
09:09:05.345026 IP >  GetResponse(32)  noSuchName@1 E:2699.
09:09:05.350218 IP >  GetResponse(28)  noSuchName@1
09:09:05.356565 IP >  GetResponse(25)  system.sysLocation.0=""
09:09:05.361866 IP >  GetResponse(33)  noSuchName@1 E:2699.
09:09:05.366185 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.372870 IP >  GetResponse(33)  noSuchName@1 E:674.10898.
09:09:05.378715 IP >  GetResponse(46)  system.sysLocation.0="5th Floor Copy Center"
09:09:05.379616 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.386339 IP >  GetResponse(30)  noSuchName@1 E:
09:09:05.395043 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.395106 IP >  GetResponse(189)  E:hp."MANUFACTURER:Hewlett-Packard;COMMAND SET:PJL,DW-PCL,ASCII;MODEL:DesignJet 500 (C7770B);CLASS:PRINTER;DESCRIPTION:Hewlett-Packard DesignJet 500 (42'' sized);"
09:09:05.411699 IP >  GetResponse(33)  noSuchName@1 E:674.10898.
09:09:05.428306 IP >  GetResponse(30)  noSuchName@1 E:641.
09:09:05.445353 IP >  GetResponse(31)  noSuchName@1 E:367.
09:09:05.461854 IP >  GetResponse(30)  noSuchName@1 E:
09:09:05.478278 IP >  GetResponse(30)  noSuchName@1 E:hp.

I opened ports on the firewall for snmp, but my cups client was still unable to discover the printers installed on the cups server on the same subnet. I did see snmp activity when doing a printer discovery, but no printers were found.

on Ubuntu 14.10 and cups 1.7 and this is still a problem

troubleshooting browsing

In, the cups manpages, I found this easy method to troubleshoot browsing:

CUPS_DEBUG_LEVEL=2 /usr/lib/cups/backend/snmp 2>&1 | tee snmp.log

If I don't crank up the debug level, I get a pretty clear picture that matches the results of "Find New Printers" in the cups web ui:

root@weasel:/home/julie/Maildir# /usr/lib/cups/backend/snmp 
network socket:// "HP LaserJet 200 color M251nw" "HP LaserJet 200 color M251nw" 
"MFG:Hewlett-Packard;CMD:PJL,PML,PCLXL,URP,PCL,PDF,POSTSCRIPT;MDL:HP LaserJet 200 color M251nw;CLS:PRINTER;DES:Hewlett-Packard LaserJet 200 color M251nw;MEM:MEM=107MB;COMMENT:RES=600x8;LEDMDIS:USB#ff#04#01;CID:HPLJPDLV1;" ""

Which leads me to this document about configuring snmp on the print server:

related references