Difference between revisions of "Cups browsing"

From Finninday
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
I'm trying to understand the basics of cups configuration for printing.
 
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 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.
  
<h3>server and client configuration</h3>
+
I'm now at cups 1.7, it looks like the browsing mechanism is bonjour (https://www.cups.org/documentation.php/doc-1.6/sharing.html)
 +
 
 +
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. (http://www.cups.org/documentation.php/doc-1.6/sharing.html)
 
The cups documentation says that it is. (http://www.cups.org/documentation.php/doc-1.6/sharing.html)
Line 38: Line 46:
 
The Listen directive is similar to the Port directive but allows you to restrict access to specific interfaces or networks.
 
The Listen directive is similar to the Port directive but allows you to restrict access to specific interfaces or networks.
  
<h3>Error message hint</h3>
+
===Error message hint===
</pre>"FirewallD is not running. Network printer detection needs services mdns, ipp, ipp-client and samba-client enabled on firewall."</pre>
+
<pre>"FirewallD is not running. Network printer detection needs services mdns, ipp, ipp-client and samba-client enabled on firewall."</pre>
  
<h3> firewall configuration</h3>
+
===firewall configuration===
 
I'm allowing port 631 tcp and udp on my local subnet
 
I'm allowing port 631 tcp and udp on my local subnet
  
<h3> network configuration</h3>
+
===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.
 
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.
  
<h3> hey, they're using snmp to talk to printers</h3>
+
===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.
 
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.
  
Line 119: Line 127:
 
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.
 
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.
  
<h3>related references</h3>
+
== 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:
 +
<pre>
 +
root@weasel:/home/julie/Maildir# /usr/lib/cups/backend/snmp
 +
network socket://10.0.0.58 "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;" ""
 +
</pre>
 +
 
 +
Which leads me to this document about configuring snmp on the print server:
 +
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-an-snmp-daemon-and-client-on-ubuntu-14-04
 +
 
 +
===related references===
 
* https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/871985
 
* https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/871985
 
* https://answers.launchpad.net/ubuntu/+source/gnome-nettool/+question/173836
 
* https://answers.launchpad.net/ubuntu/+source/gnome-nettool/+question/173836
 
* https://mail.gnome.org/archives/commits-list/2011-July/msg09761.html
 
* https://mail.gnome.org/archives/commits-list/2011-July/msg09761.html
 
* http://www.troubleshootingwiki.org/Basic_Debugging_in_CUPS-SNMP
 
* http://www.troubleshootingwiki.org/Basic_Debugging_in_CUPS-SNMP

Latest revision as of 01:44, 16 November 2014

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 (https://www.cups.org/documentation.php/doc-1.6/sharing.html)

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. (http://www.cups.org/documentation.php/doc-1.6/sharing.html)

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 255.0.0.0, 255.255.0.0, and 255.255.255.0, 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 ryan.day]# tcpdump -p -i em1 port snmp; # client is 10.50.1.101
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 10.50.1.101.39552 > 10.50.255.255.snmp:  GetRequest(28)  25.3.2.1.2.1
09:09:05.306093 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(37)  25.3.2.1.2.1=25.3.1.5
09:09:05.311978 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(37)  25.3.2.1.2.1=25.3.1.5
09:09:05.321970 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(28)  noSuchName@1 25.3.2.1.2.1=
09:09:05.322647 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(28)  25.3.2.1.3.1
09:09:05.322807 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(32)  E:2699.1.2.1.2.1.1.3.1
09:09:05.322815 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(33)  E:2699.1.2.1.3.1.1.4.1.1
09:09:05.322820 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(25)  system.sysLocation.0
09:09:05.322825 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(30)  E:641.2.1.2.1.2.1
09:09:05.323369 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(37)  25.3.2.1.3.1="FS-C5015N"
09:09:05.323388 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(148)  E:2699.1.2.1.2.1.1.3.1="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 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(33)  E:674.10898.100.2.1.2.1.2.1
09:09:05.323418 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(30)  E:641.2.1.2.1.3.1
09:09:05.323423 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(31)  E:367.3.2.1.1.1.11.0
09:09:05.323629 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(33)  E:2699.1.2.1.3.1.1.4.1.1=""
09:09:05.323865 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(30)  E:128.2.1.3.1.2.0
09:09:05.323874 IP 10.50.1.101.39552 > 10.50.100.2.snmp:  GetRequest(30)  E:hp.2.3.9.1.1.7.0
09:09:05.323996 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(25)  system.sysLocation.0=""
09:09:05.324004 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.2.1=
09:09:05.324018 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(28)  25.3.2.1.3.1
09:09:05.324026 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(32)  E:2699.1.2.1.2.1.1.3.1
09:09:05.324032 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(33)  E:2699.1.2.1.3.1.1.4.1.1
09:09:05.324037 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(25)  system.sysLocation.0
09:09:05.324042 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(30)  E:641.2.1.2.1.2.1
09:09:05.324046 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(33)  E:674.10898.100.2.1.2.1.2.1
09:09:05.324052 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(30)  E:641.2.1.2.1.3.1
09:09:05.324058 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(31)  E:367.3.2.1.1.1.11.0
09:09:05.324063 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(30)  E:128.2.1.3.1.2.0
09:09:05.324081 IP 10.50.1.101.39552 > 10.50.100.3.snmp:  GetRequest(30)  E:hp.2.3.9.1.1.7.0
09:09:05.324272 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(33)  noSuchName@1 E:674.10898.100.2.1.2.1.2.1=
09:09:05.324544 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.3.1=
09:09:05.324559 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(31)  noSuchName@1 E:367.3.2.1.1.1.11.0=
09:09:05.324563 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:128.2.1.3.1.2.0=
09:09:05.324803 IP 10.50.100.2.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:hp.2.3.9.1.1.7.0=
09:09:05.325152 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(28)  25.3.2.1.3.1
09:09:05.325158 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(32)  E:2699.1.2.1.2.1.1.3.1
09:09:05.325160 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(33)  E:2699.1.2.1.3.1.1.4.1.1
09:09:05.325162 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(25)  system.sysLocation.0
09:09:05.325164 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(30)  E:641.2.1.2.1.2.1
09:09:05.325165 IP 10.50.1.101.39552 > 10.50.100.1.snmp:  GetRequest(33)  E:674.10898.100.2.1.2.1.2.1
09:09:05.330481 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(53)  25.3.2.1.3.1="KONICA MINOLTA bizhub 600"
09:09:05.335709 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(32)  noSuchName@1 E:2699.1.2.1.2.1.1.3.1=
09:09:05.342764 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(33)  noSuchName@1 E:2699.1.2.1.3.1.1.4.1.1=
09:09:05.345026 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(32)  noSuchName@1 E:2699.1.2.1.2.1.1.3.1=
09:09:05.350218 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(28)  noSuchName@1 25.3.2.1.3.1=
09:09:05.356565 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(25)  system.sysLocation.0=""
09:09:05.361866 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(33)  noSuchName@1 E:2699.1.2.1.3.1.1.4.1.1=
09:09:05.366185 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.2.1=
09:09:05.372870 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(33)  noSuchName@1 E:674.10898.100.2.1.2.1.2.1=
09:09:05.378715 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(46)  system.sysLocation.0="5th Floor Copy Center"
09:09:05.379616 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.3.1=
09:09:05.386339 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:128.2.1.3.1.2.0=
09:09:05.395043 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.2.1=
09:09:05.395106 IP 10.50.100.3.snmp > 10.50.1.101.39552:  GetResponse(189)  E:hp.2.3.9.1.1.7.0="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 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(33)  noSuchName@1 E:674.10898.100.2.1.2.1.2.1=
09:09:05.428306 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:641.2.1.2.1.3.1=
09:09:05.445353 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(31)  noSuchName@1 E:367.3.2.1.1.1.11.0=
09:09:05.461854 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:128.2.1.3.1.2.0=
09:09:05.478278 IP 10.50.100.1.snmp > 10.50.1.101.39552:  GetResponse(30)  noSuchName@1 E:hp.2.3.9.1.1.7.0=

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://10.0.0.58 "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: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-an-snmp-daemon-and-client-on-ubuntu-14-04

related references