- Alexander Leidinger - https://www.leidinger.net/blog -

The doc­u­men­ta­tion of CUPS is not very good (CUPS client setup)

Yes­ter­day evening I did set­up a CUPS [1] serv­er at home. It was on my TODO list since years. Before I just went down­stairs and con­nect­ed the print­er via USB to the laptop/netbook for print­ing (to pick­up the print­out I have to go there any­way). It is not the first time that I set­up the serv­er side of CUPS, but it was the first time that I want­ed to use the CUPS com­mand line util­i­ties instead of the FreeBSD/Solaris printspool­er and the native lpr/lp commands.

First I just had a look at some man-pages of the CUPS util­i­ties, in the hope to find some com­mand to tell that any print­ing should be done via a remote CUPS serv­er. As I did not find any­thing, I went to the doc­u­men­ta­tion page of CUPS [2] to search there. To me this is some sim­ple con­fig part if you want to print from more than one machine, so I had a look at the “Get­ting Start­ed” part. This was a total fail­ure. I found noth­ing relat­ed to my prob­lem. After that I went to the “Man Pages” part to search for a com­mand which I may have over­looked. Again, a total fail­ure. The FAQ also does not con­tain any use­ful infor­ma­tion when you search for “client” or “remote”. In the end I stum­bled over the client.conf entry in the Ref­er­ences part. After I found this it was easy (and fast, I just added a line in client.conf with “Server­Name <serv­er>” and every­thing worked as I want­ed it to work).

The set­up in Win­dows XP to use the CUPS serv­er is easy, just add a net­work print­er via http://<server>:631/printers/<printer> and use the cor­rect print­er dri­ver for your print­er mod­el. Do not for­get to make the application/object-stream in the mime* con­fig files and allow remote print­ing in the serv­er. No, I do not want to inte­grate it into Sam­ba, the num­ber of Win­dows sys­tems is very lim­it­ed (2 Win­dows against 2 Unix machines with 14 light­weight vir­tu­al Unix machines [3]), so I do not need this.

[9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49]Share/Save [50]
8 Comments (Open | Close)

8 Comments To "The doc­u­men­ta­tion of CUPS is not very good (CUPS client setup)"

#1 Comment By DES On October 7, 2009 @ 23:40

Uh, you don”t need to edit client.conf. The client should auto­mat­i­cal­ly pick up print­ers adver­tised by the serv­er. All you need to do is add “Allow @LOCAL” to the “<Loca­tion />” sec­tion in cupsd.conf on the serv­er. The syn­tax is pret­ty much the same as for Apache; see the cupsd.conf ref­er­ence for details.

#2 Comment By netchild On October 8, 2009 @ 08:22

My CUPS serv­er and the client are in a jail. I have the fol­low­ing in the cups.conf, but lpstat ‑p ‑a does not give me a list of print­ers with­out 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 “Loca­tion /” 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 mat­ters, both jails have the broad­cast address set to .255 of the /24 net­work they are in (ifcon­fig IF alias 192.168.1.X/32 broad­cast 192.168.1.255).

#3 Comment By DES On October 8, 2009 @ 09:23

1) BrowseAl­low means “accept print­er adver­tise­ments from these IP address­es”. They are not need­ed on the serv­er. On the client, the default (@LOCAL) is sufficient.

2) The first two Allow lines in your <Loca­tion /> have no effect. The last one (@LOCAL) is sufficient.

3) Try to con­nect to [51] from the client. If it lets you in, your <Loca­tion /> is fine, and the prob­lem is relat­ed to print­er advertisement.

4) On the client (or on a ran­dom machine on the same LAN), run ‘’tcp­dump ‑n udp port 631’’; you should see print­er adver­tise­ment pack­ets every 30 sec­onds. If you don”t see them, run tcp­dump on the serv­er to make sure they”re actu­al­ly going out. Check your fire­wall settings.

5) Take a look at [52].

#4 Comment By DES On October 8, 2009 @ 09:26

Uhm,

0) did you remem­ber to start cups on the client? 🙂

#5 Comment By netchild On October 9, 2009 @ 09:25

0) The point is, I do not want to start (or to install) the serv­er on the client. I just want to print, and CUPS allows me to do it with the client.conf set­ting. I know, this is dif­fer­ent from the tra­di­tion­al BSD lpd behav­ior, but it works and is one dae­mon less to care about.

2) CUPS is on 192.168.1.x (as is the FreeB­SD client which trig­gered this post­ing), the 192.168.2.x is my WLAN via a WLAN router (for the net­book when used in the liv­ing room), I do not have an IP of this range on the printserv­er. Does @LOCAL still cov­er this (I would expect it looks at the net­mask of the inter­face, which is /32 in my case, if it is tak­ing the /24, I can imag­ine sit­u­a­tions where I would be upset about it)? If yes, what range is CUPS tak­ing into @LOCAL (a point­er to the expla­na­tion is enough)?

4) I see pack­ets going to the broad­cast address.

#6 Pingback By Alexan­der Lei­dinger: More prob­lems with CUPS (pass­ing env vari­ables) « The Dai­ly BSD On October 13, 2009 @ 09:09

[…] where the font files are locat­ed (export GS_LIB=/path/to/dir1/path/to/dir2). Now that I switched to use CUPS as my printserv­er soft­ware, I had to teach it to set this for the call to gs (via foomat­ic). Unfor­tu­nate­ly I failed to get it […]

#7 Pingback By More prob­lems with CUPS (pass­ing env vari­ables) « The Dai­ly BSD On October 22, 2009 @ 03:02

[…] where the font files are locat­ed (export GS_LIB=/path/to/dir1/path/to/dir2). Now that I switched to use CUPS as my printserv­er soft­ware, I had to teach it to set this for the call to gs (via foomat­ic). Unfor­tu­nate­ly I failed to get it […]

#8 Pingback By SUN Open­Stor­age pre­sen­ta­tion « The Dai­ly BSD On November 20, 2009 @ 11:09

[…] The doc­u­men­ta­tion of CUPS is not very good (CUPS client setup) […]