Alexander Leidinger

Just another weblog

Oct
07

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

Yes­ter­day evening I did setup a CUPS server at home. It was on my TODO list since years. Before I just went down­stairs and con­nected the printer via USB to the laptop/netbook for print­ing (to pickup the print­out I have to go there any­way). 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 com­mand line util­i­ties 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 util­i­ties, in the hope to find some com­mand to tell that any print­ing should be done via a remote CUPS server. As I did not find any­thing, I went to the doc­u­men­ta­tion page of CUPS 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 Started” part. This was a total fail­ure. I found noth­ing related 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 <server>” and every­thing worked as I wanted it to work).

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

GD Star Rat­ing
load­ing…
GD Star Rat­ing
load­ing…

Tags: , , , , , , , , ,

8 Responses to “The doc­u­men­ta­tion of CUPS is not very good (CUPS client setup)”

  1. DES Says:

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

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  2. netchild Says:

    My CUPS server 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 /” sec­tion:
    —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).

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  3. DES Says:

    1) BrowseAl­low means “accept printer adver­tise­ments 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 <Loca­tion /> have no effect. The last one (@LOCAL) is sufficient.

    3) Try to con­nect to http://192.168.1.X:631/ from the client. If it lets you in, your <Loca­tion /> is fine, and the prob­lem is related to printer 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 printer adver­tise­ment pack­ets every 30 sec­onds. If you don”t see them, run tcp­dump on the server to make sure they”re actu­ally going out. Check your fire­wall settings.

    5) Take a look at http://192.168.1.X:631/help/.

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  4. DES Says:

    Uhm,

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

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  5. netchild Says:

    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 set­ting. I know, this is dif­fer­ent from the tra­di­tional 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 FreeBSD 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 printserver. Does @LOCAL still cover 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 pointer to the expla­na­tion is enough)?

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

    GD Star Rating
    loading...
    GD Star Rating
    loading...
  6. Alexander Leidinger: More problems with CUPS (passing env variables) « The Daily BSD Says:

    […] where the font files are located (export GS_LIB=/path/to/dir1/path/to/dir2). Now that I switched to use CUPS as my printserver soft­ware, I had to teach it to set this for the call to gs (via foomatic). Unfor­tu­nately I failed to get it […]

  7. More problems with CUPS (passing env variables) « The Daily BSD Says:

    […] where the font files are located (export GS_LIB=/path/to/dir1/path/to/dir2). Now that I switched to use CUPS as my printserver soft­ware, I had to teach it to set this for the call to gs (via foomatic). Unfor­tu­nately I failed to get it […]

  8. SUN OpenStorage presentation « The Daily BSD Says:

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

Leave a Reply