3

I have a CUPS server with two print queues defined. Once this was defined, all the CUPS clients on the same subnet could see the two print queues automatically, no problem.

Now I have a collection of machines on a separate subnet, reachable from the first subnet by a router.

How do I enable CUPS browsing on the second set of machines so that they can see the print queues defined on the first machine?

Let's call the server A.B.C.7. The first subnet is A.B.C.0/24. The second subnet is A.B.D.0/24, and there is a router with arms on both networks.

3 Answers 3

7

The 'native' way is to have a CUPS server (they don't need printers, just the CUPS software) on each subnet, and configure those servers to act as a Browse Relay server. The configuration would be

BrowsePoll a.b.c.7
BrowseRelay CUPS

That CUPS-running server will then respond to subnet-local browse requests with the remote server.

There is also a way to do it via multicast and the Service Location Protocol, but it isn't documented well at all.

1
  • Marking as accepted because this worked for me. Nov 5, 2012 at 16:25
1

cups 1.6 used dnssd. This multicast to 224.0.0.251 port 5353. As router are not allowed to forward 224.0.0.251 the packets are stuck on the gateway border.

You could use avahi-daemon mDNS reflector feature on the gateway .

NB: If you nat at the gateway you will need to set NONAT for packets incoming from the parent network. In shorewall/masq file:

<external_interface> <parent_net_ip_range>    NONAT
<external_interface> 224.0.0.0/4     NONAT
<external_interface>:!<parent_net_ip_range>,224.0.0.0/4 <subnet_ip_range> detect

avahi-daemon.conf on the router

[reflector]
enable-reflector=yes

avahi-daemon will reflect incoming mDNS requests to all local network interfaces,  effectively allowing clients to browse mDNS/DNS-SD services on all networks connected to the      gateway. 
Make sure to not run multiple reflectors between the same networks, this might cause them to play  Ping  Pong with mDNS packets.

PS: One could need to mangle the packets to increase Time To Live. This is a topic that needs more investigations though here are the shorewall/start, raw iptables tweaks:

/sbin/iptables -t mangle -A PREROUTING -p all -s 224.0.0.0/4 -j TTL --ttl-inc <ttl_inc>
/sbin/iptables -t mangle -A PREROUTING -p all -d 224.0.0.0/4 -j TTL --ttl-inc <ttl_inc>
/sbin/iptables -t mangle -A PREROUTING -p all -s <parent_net_ip_range> -j TTL --ttl-inc <ttl_inc>
/sbin/iptables -t mangle -A PREROUTING -p all -d <parent_net_ip_range> -j TTL --ttl-inc <ttl_inc>

ttl_inc: any number starting from one. I use twenty locally though it is not set in stone. Mostly depends on the number of routers crossed in between printer and client station.

Gnome control center "printers" here send a ttl f 255 (the maximum) so it is not required.

0

As far as I know there is no way to automatically make it available to other clients that are not on the same subnet. CUPS announces itself with multicast dns packets. You can still use the printer from another subnet (if the access controls are right), but you have to add it manually refering to by its IP address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .