Yesterday evening I did setup a CUPS server at home. It was on my TODO list since years. Before I just went downstairs and connected the printer via USB to the laptop/netbook for printing (to pickup the printout I have to go there anyway). It is not the first time that I setup the server side of CUPS, but it was the first time that I wanted to use the CUPS command line utilities instead of the FreeBSD/Solaris printspooler and the native lpr/lp commands.
First I just had a look at some man-pages of the CUPS utilities, in the hope to find some command to tell that any printing should be done via a remote CUPS server. As I did not find anything, I went to the documentation page of CUPS to search there. To me this is some simple config part if you want to print from more than one machine, so I had a look at the “Getting Started” part. This was a total failure. I found nothing related to my problem. After that I went to the “Man Pages” part to search for a command which I may have overlooked. Again, a total failure. The FAQ also does not contain any useful information when you search for “client” or “remote”. In the end I stumbled over the client.conf entry in the References part. After I found this it was easy (and fast, I just added a line in client.conf with “ServerName <server>” and everything worked as I wanted it to work).
The setup in Windows XP to use the CUPS server is easy, just add a network printer via http://<server>:631/printers/<printer> and use the correct printer driver for your printer model. Do not forget to make the application/object-stream in the mime* config files and allow remote printing in the server. No, I do not want to integrate it into Samba, the number of Windows systems is very limited (2 Windows against 2 Unix machines with 14 lightweight virtual Unix machines), so I do not need this.
Uh, you don”t need to edit client.conf. The client should automatically pick up printers advertised by the server. All you need to do is add “Allow @LOCAL” to the “<Location />” section in cupsd.conf on the server. The syntax is pretty much the same as for Apache; see the cupsd.conf reference for details.
My CUPS server and the client are in a jail. I have the following in the cups.conf, but lpstat ‑p ‑a does not give me a list of printers without using the client.conf:
—snip—
Browsing On
BrowseOrder allow,deny
BrowseAllow 192.168.1.0/24
BrowseAllow 192.168.2.0/24
BrowseAddress @LOCAL
—snip—
And in the “Location /” section:
—snip—
Allow from 192.168.1.0/24
Allow from 192.168.2.0/24
# Allow shared printing and remote administration...
Order allow,deny
Allow @LOCAL
—snip—
If it matters, both jails have the broadcast address set to .255 of the /24 network they are in (ifconfig IF alias 192.168.1.X/32 broadcast 192.168.1.255).
1) BrowseAllow means “accept printer advertisements from these IP addresses”. They are not needed on the server. On the client, the default (@LOCAL) is sufficient.
2) The first two Allow lines in your <Location /> have no effect. The last one (@LOCAL) is sufficient.
3) Try to connect to http://192.168.1.X:631/ from the client. If it lets you in, your <Location /> is fine, and the problem is related to printer advertisement.
4) On the client (or on a random machine on the same LAN), run ‘’tcpdump ‑n udp port 631’’; you should see printer advertisement packets every 30 seconds. If you don”t see them, run tcpdump on the server to make sure they”re actually going out. Check your firewall settings.
5) Take a look at http://192.168.1.X:631/help/.
Uhm,
0) did you remember to start cups on the client? 🙂
0) The point is, I do not want to start (or to install) the server on the client. I just want to print, and CUPS allows me to do it with the client.conf setting. I know, this is different from the traditional BSD lpd behavior, but it works and is one daemon less to care about.
2) CUPS is on 192.168.1.x (as is the FreeBSD client which triggered this posting), the 192.168.2.x is my WLAN via a WLAN router (for the netbook when used in the living room), I do not have an IP of this range on the printserver. Does @LOCAL still cover this (I would expect it looks at the netmask of the interface, which is /32 in my case, if it is taking the /24, I can imagine situations where I would be upset about it)? If yes, what range is CUPS taking into @LOCAL (a pointer to the explanation is enough)?
4) I see packets going to the broadcast address.