[Wylug-help] tcp/ip printing

Robin B Martin rbmartin at dsl.pipex.com
Wed Sep 3 09:35:49 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 02 Sep 2003 9:03 am, Nigel Metheringham wrote:
> On Mon, 2003-09-01 at 17:12, w tom lawrie wrote:
> > i have just installed RH9 and updated it via the Red Hat Network. i need
> > to be able to print to a printer using its ip address 206.xxx.xxx.xxx
> > etc. i managed it under win2000 but am having difficulty setting it up
> > under linux. the printer configuration utility offers IPP using CUPS but
> > this does not appear to work. any suggestions on where to start? i have
> > already searched the wylug help archives without finding anything of
> > use. the name of the relevant HOWTO file might be a starting point.
> > thanks in advance
> > nugget newbie
>
> Best thing to do is portscan the printer to see what protocols it
> apparently supports:-
>
>         > nmap 1.2.3.4
>
>         Starting nmap 3.26 ( www.insecure.org/nmap/ ) at 2003-09-02 08:56
> BST Interesting ports on 1.2.3.4
>         (The 1616 ports scanned but not shown below are in state: closed)
>         Port       State       Service
>         21/tcp     open        ftp
>         23/tcp     open        telnet
>         80/tcp     open        http
>         280/tcp    open        http-mgmt
>         515/tcp    open        printer
>         631/tcp    open        ipp
>         9100/tcp   open        jetdirect
>
> This printer is a relatively modern HP, which can handle the lpd
> protocol (port 515/printer), ipp (port 631) and jetdirect (port 9100).
>
> I actually run it using jetdirect since the IPP support is buggy
> (actually the whole damn printer is buggy, but this way crashes it a
> little less than other means).
>
> 	Nigel.
>
>
> --
> [ Nigel Metheringham           Nigel.Metheringham at InTechnology.co.uk ]
> [ - Comments in this message are my own and not ITO opinion/policy - ]
>
>
> _______________________________________________
> Wylug-help mailing list
> Wylug-help at wylug.org.uk
> http://list.wylug.org.uk/mailman/listinfo/wylug-help

Tom

I don't know if this will help but here is how I got my printers to be
accessible across the lan.  I'm using Slackware 9, so things may be in
different places in RedHat but the logic is the same.
1. Make sure that you have the relevant ppd file for your printer in the
locations described here. http://www.linuxprinting.org/cups-doc.html
2. edit the cupsd.conf file on your server 206.xxx.xxx.xxx it should be here
/etc/cups/cupsd.conf this  file is very long but if you work through it it
almost explains itself, basically you set the ip addresses that cups
broadcasts to and the permissions of the devices.  If this is not set
correctly your clients will not see the printers.  It is very tempting to use
the KDE printer setup for this don't! it garbles the cupsd.conf.

Here are some of the relevant sections from my cupsd.conf on my server.

########
######## Network Options
########

#
# Ports/addresses that we listen to.  The default port 631 is reserved
# for the Internet Printing Protocol (IPP) and is what we use here.
#
# You can have multiple Port/Listen lines to listen to more than one
# port or address, or to restrict access:
#
#    Port 80
#    Port 631
#    Listen hostname
#    Listen hostname:80
#    Listen xxxxxxxxxx:631
#    Listen 1.2.3.4
#    Listen 1.2.3.4:631
#
Listen 192.168.7.*  # this restricts access to the printer to my local lan
i.e. cups will only listen for connects from these addresses you can fine
tune this to individual machines
# NOTE: Unfortunately, most web browsers don't support TLS or HTTP Upgrades
# for encryption.  If you want to support web-based encryption you'll
# probably need to listen on port 443 (the "https" port...)
#

#Port 80
#Port 443
Port 631# which port to listen on default 631 ipp

########
######## Browsing Options
########

#
# Browsing: whether or not to broadcast and/or listen for CUPS printer
# information on the network.  Enabled by default.
#

Browsing On

#
# BrowseProtocols: which protocols to use for browsing.  Can be
# any of the following separated by whitespace and/or commas:
#
#     all  - Use all supported protocols.
#     cups - Use the CUPS browse protocol.
#     slp  - Use the SLPv2 protocol.
#
# The default is "cups".
#
# NOTE: If you choose to use SLPv2, it is *strongly* recommended that
#       you have at least one SLP Directory Agent (DA) on your
#       network.  Otherwise, browse updates can take several seconds,
#       during which the scheduler will not respond to client
#       requests.
#

BrowseProtocols cups

#
# BrowseAddress: specifies a broadcast address to be used.  By
# default browsing information is not sent!
#
# Note: HP-UX does not properly handle broadcast unless you have a
# Class A, B, C, or D netmask (i.e. no CIDR support).
#
# Note: Using the "global" broadcast address (255.255.255.255) will
# activate a Linux demand-dial link with the default configuration.
# If you have a LAN as well as the dial-up link, use the LAN's
# broadcast address.
#
# The @LOCAL address broadcasts to all non point-to-point interfaces.
# For example, if you have a LAN and a dial-up link, @LOCAL would
# send printer updates to the LAN but not to the dial-up link.
# Similarly, the @IF(name) address sends to the named network
# interface, e.g. @IF(eth0) under Linux.  Interfaces are refreshed
# automatically (no more than once every 60 seconds), so they can
# be used on dynamically-configured interfaces, e.g. PPP, 802.11, etc.
#

#BrowseAddress x.y.z.255
#BrowseAddress x.y.255.255
#BrowseAddress x.255.255.255
#BrowseAddress 255.255.255.255
BrowseAddress @LOCAL
#BrowseAddress @IF(name)
#BrowseAddress 192.168.7.255
#
# BrowseShortNames: whether or not to use "short" names for remote printers
# when possible (e.g. "printer" instead of "printer at host".)  Enabled by
# default.
#
BrowseShortNames Yes

#
# BrowseAllow: specifies an address mask to allow for incoming browser
# packets. The default is to allow packets from all addresses.
#
# BrowseDeny: specifies an address mask to deny for incoming browser
# packets. The default is to deny packets from no addresses.
#
# Both "BrowseAllow" and "BrowseDeny" accept the following notations for
# addresses:
#
#     All
#     None
#     *.domain.com
#     .domain.com
#     host.domain.com
#     nnn.*
#     nnn.nnn.*
#     nnn.nnn.nnn.*
#     nnn.nnn.nnn.nnn
#     nnn.nnn.nnn.nnn/mm
#     nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm
#     @LOCAL
#     @IF(name)
#
# The hostname/domainname restrictions only work if you have turned hostname
# lookups on!
#
BrowseAllow 127.0.0.1
BrowseAllow 192.168.7.*
BrowseDeny ALL

pretty easy so far... telling cups to use its own protocol and resstricting it
to the local lan and localhost deny from ALL others

#
# BrowsePoll: poll the named server(s) for printers
#

BrowsePoll 192.168.7.50:631 # where the printers are !

further down in the cupsd.conf there is a section on security, here you either
Allow, deny and set order for processing each section? begins <Location>  and
ends </Location> in these sections you must set the process order and where
to allow access from.  here is my example

<Location /printers>
#
# You may wish to limit access to printers and classes, either with Allow
# and Deny lines, or by requiring a username and password.
#
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.7.*
Encryption IfRequested
</Location>

denying access to all but localhost and lan, fill in your details as
appropriate, the other sections <Location ...> all follow the same rules.

Now that you have set up the cupsd.conf you need to set up the client on the
machine you wish to print from open /etc/cups/client.conf
and change ServerName to the well name of your server note if your going to
use a name like printer.hostname you need that in your /etc/hosts otherwise I
think an IP will do.

Remember to restart the cups server on both machines before you attempt to
print.  Don't be put off by this, it takes longer to type than to do, and
once you get used to te structure of the document it takes no time at all.

Let me know if this was useful.


rob

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/VagBn3+UKE3uMlcRApZbAJ9KgC3+FymZh1Oij/7sg9djlGtU1wCdGA1u
kdZpUPCH1wKx51Mpr1obW5c=
=TMQA
-----END PGP SIGNATURE-----





More information about the Wylug-help mailing list