Printing on a LAN

pipitas k1pfeifle at gmx.net
Sun Jan 9 16:57:03 PST 2005


Daniel Kasak wrote:

> Murphy wrote:
>> I have two Slackware machines setup, one with a printer attached which I
>> have configured and can print to using CUPS fine.
>> 
>> I would like the second machine to print to the printer attached to the
>> first machine however I am at a loss as to how it's done.
>> 
>> On the second machine I have CUPS up and running and understand that on a
>> local network the printers should be listed within 30 secs however
>> nothing gets listed.
>> 
>> Should I add the printer using the CUPS web admin on the second machine,
>> as I did on the first, then point it to the first machine ?
>> 
>> I liked the idea of the printers on the local lan being listed
>> automatically as our lan is a simple 3 workstations and from an admin
>> point of view this sounds very appealing...
>> 
>> Thanks
>> 
>> Murphy
> 
> Ha! Good luck :)
> 
> It took me an enormous amount of time to get this feature to work.
> Acutally it was a 2-man job ... each of us taking it in turns while the
> other one went out for a cigarette break and a vodka :)

Usually it only takes one, who is able to read documentation
and grok it...  ;-)

But i admit: a lot of Linux distributions nowadays install their
own tweaked cupsd.conf versions, which do not enable the CUPS
clients to print out of the box, even if a completely working
and ready-configured CUPS server is around.

> You need the following options:
> 
> ---
> 
> Browsing On
> BrowseProtocols cups
> BrowseAddress 10.146.255.255
> BrowseAllow 10.146.0.0/10.146.255.255
> BrowseInterval 30
> BrowseOrder allow,deny
> BrowsePort 631
> 
> ---

The most *simple* configuration for a client only has this (and these
should even be the defaults, i.e. working even if the lines are
commented out):

 Browsing On
 BrowseProtocols cups
 BrowsePort 631

No need for "BrowseAddress" settings on the clients.

The "BrowseAddress" is only for CUPS *servers*. CUPS servers are
those machines which have printers defined in their config file
/etc/cups/printers.conf (dont edit -- use "lpadmin" command or the
CUPS web interface to install printers). 

BrowseAddress specifies the scope of broadcast addresses where 
potential CUPS clients reside, which get informed about the 
available printers, their names, their URLs and their state.

So on the CUPS server, having the same settings as above, plus
one more, should make everything work:

 Browsing On
 BrowseProtocols cups
 BrowsePort 631
 BrowseAddress @LOCAL

The "@LOCAL" keyword is an abbreviation to say send broacast
information to all of the LAN addresses I am directly connected
to, through all my eth* interfaces (but dont use modem or ppp*
interfaces)".

> Right, now firstly, you need to modify the ip addresses to fit your
> network. The BrowseAddress should be at the end of your network range (
> ending in 255.255 ). I'm not networking expert, so forgive me if the
> above description isn't particularly accurate. The BrowseAllow is the
> range of addresses that are allowed to browse.
> 
> Next, you may or may not need the following options set. Like I said, it
> took us a *lot* of mucking around to get it to work, and by the end we
> were so confused / frustrated that we really have no idea how we finally
> got it working.
> 
> ---
> 
> <Location /jobs>
> AuthClass Anonymous
> AuthType None
> Allow from @LOCAL
> Allow from 127.0.0.1
> Allow From 10.146.0.0/10.146.255.255
> </Location>
> 
> <Location /printers/RicohAP3200>
> AuthClass Anonymous
> AuthType None
> #Order Allow,Deny
> Allow From @LOCAL
> Allow From 10.146.0.0/10.146.255.255
> </Location>
> 
> <Location /printers/Laserjet4500>
> AuthClass Anonymous
> AuthType None
> #Order Allow,Deny
> Allow From @LOCAL
> Allow From 10.146.0.0/10.146.255.255
> </Location>
> 
> ---
> 
> You need to define each of your printers in the cupsd.conf file as above
> for browsing to work. 

Actually, that is not true. It is sufficient to do it like 
this:

  <Location /printers>
  AuthClass Anonymous
  AuthType None
  Order Allow,Deny
  Deny From All
  Allow From 10.146.0.0/10.146.255.255
  </Location>

or similar. This provides the same definition of access rights for each 
individual printer.

Of course your setup works too. But the idea to define different printer
locations is when you want to establish *different* settings for each one.
So the <Location /printers>....</Location> would define the general rules
and some individual <Location /printers/name>....</Location> sections
would override these rules for the named printers only.

> The 'Allow From @LOCAL' option by itself doesn't 
> work for us,

Doesnt it even work with this
  
  Order Deny,Allow
  Deny From All
  Allow From @LOCAL

? If so, it is a bug in your CUPS version. The @LOCAL would allow all jobs
coming from your eth0, eth1, eth2,.... interfaces, but not the ones coming
from ppp0, ppp1,.... (i.e. modems, ISDN cards).

Cheers,
Kurt





More information about the cups mailing list