Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
Marking as accepted because this worked for me. –  David Mackintosh Nov 5 '12 at 16:25
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.