Redirecting data sent to a local printer to another host and port on the network
From: Fernando Ronci (fernandoronci_at_hotmail.com)
Date: 01/25/04
- Next message: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Previous message: Tony Lawrence: "Re: Building Samba version 3.0.1 on OSR5.0.6"
- Next in thread: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Reply: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Reply: Jeff Liebermann: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Jan 2004 12:54:53 -0800
Hi all,
Scenario:
I have a local network with an SCO 5.0.5 server running an accounting
application and several windows 98 workstations -each with its own
printer- accessing the SCO server via TinyTerm.
Here everything works OK. All client workstations have access to the
application and print to their respectively attached printers.
Also, there are two other Windows 98 workstations (each with its own
attached printer too) in a remote branch site, connected to the
central site through a cablemodem service provided by an ISP.
The goal is to allow users at the remote site (who also access the
application on the SCO server via TinyTerm) to print to their local
printers. For one client, the approach taken at the central site was
to configure a network printer on the SCO server and point it to a
windows 98 machine running a proxy (in this case the product used was
'hhproxy' for windows) which maps and forwards all traffic sent to
port 515 to the IP address (and port 515) of the actual remote
workstation at the branch site where the print job originated. That
remote workstation runs 'winlpd', a windows lpd daemon that catches
traffic on port 515 and prints it on its local printer. This is
working perfectly well for this 1st remote client workstation.
The problem arises when I have to set up printing for the 2nd remote
client workstation because the mapping of port 515 already goes to the
1st one. To overcome this, I took the example from
http://www.pcunix.com/SCOFAQ/scotec7.html and:
1) Installed the 'netcat' ELF binary from ftp://pcunix.com/pub/netcat
on /usr/bin and set the right permissions.
2) Manually added a local printer named 'epsonlx810' (the actual
printer on the remote 2nd client is a dot matrix Epson LX 810) using
the 'netcat' model interface script (also from Tony Lawrence's FAQ)
which had previously been saved on /usr/spool/lp/model:
/usr/lib/lpadmin -p epsonlx810 -m netcat -v /dev/null
where the 'netcat' interface script contains:
# PORT=9100 # for hp, netgear, some others
shift; shift; shift; shift; shift
# The lpsched program sends 5 arguments that we are going to ignore.
# arguments 6 and on are the file names to be printed
# We just throw away everything but the file names by using shift
# 5 times
# arguments 6 through whatever are now $*
cat $* | netcat -h 192.168.0.1 -p 9100
# If you need lfcr translation, do:
# cat $* | /usr/lib/lponlcr | netcat -h printserver -p $PORT
# If you need a pagefeed, do:
# cat $* /usr/lib/Control_L | /usr/lib/lponlcr |
# netcat -h printserver -p $PORT
# 192.168.0.1 is the ip address of the Windows 98 machine
# running 'hhproxy'
I picked port 9100 because port 515 is already used to handle traffic
from the system's network printer. Anyway, 'hhproxy' will map port
9100 back to 515 when forwarding traffic to 'winlpd' on the 2nd remote
client. Port number 9100 was chosen for the sole purpose of providing
'hhproxy' a means to decide where packets come from and where to
forward them, that is, traffic to 'hhproxy' on port 515 goes to 1st
remote client's winlpd at port 515 whereas traffic to 'hhproxy' on
port 9100 goes to 2nd remote client's winlpd at port 515.
Then I ran '/usr/lib/accept epsonlx810' and 'enable epsonlx810'
Unfortunately this didn't work. Print jobs sent to the 'epsonlx810'
printer don't reach the remote printer. It seems as if 'netcat' isn't
doing its job because 'hhproxy' on the windows 98 machine (on the same
ethernet
segment) never receives any traffic on port 9100. What's more, leaving
the printing issue aside for a moment, a simple test with 'netcat'
trying to redirect its piped input doesn't work. For example, given a
test text file (say 'test.txt'), the following command doesn't work:
cat test.txt | netcat -h 192.168.0.1 -p 9100
where 192.168.0.1 is the IP address of the windows 98 machine running
'hhproxy'. Here, according to the logs on host 192.168.0.1, it never
receives anything on port 9100, so nothing gets mapped and forwarded
to the remote 2nd client with the Epson printer attached.
At the same time, 'lpstat' returns nothing. Because of this, I think
there exists an issue with my set up of 'netcat' on the SCO server and
not 'hhproxy' or 'winlpd' on the other hosts.
Can anyone please tell me what I did wrong or why netcat (and
therefore remote printing) is not functioning the way I thought it
should ? What would be the recommended or most appropriate approach
for this ?
If it were possible to set up a network printer on the SCO server to
use a port other than 515 I wouldn't have to mess with 'netcat'.
As I said above, traffic on port 515 is taken by 'hhproxy', then
mapped and forwarded to the 1st client at the remote branch, that's
why I had to pick other unused port number like 9100. I visited
http://www.pcunix.com/Jeffl/portnumbers.html for reference.
Anyway, before discussing printing issues, it's netcat that seems to
not be working here as can be told from 'hhproxy' logs.
I hope everybody understands what I tried to explain.
Thank you,
Fernando Ronci
E-mail: fernandoronci@hotmail.com
- Next message: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Previous message: Tony Lawrence: "Re: Building Samba version 3.0.1 on OSR5.0.6"
- Next in thread: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Reply: Tony Lawrence: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Reply: Jeff Liebermann: "Re: Redirecting data sent to a local printer to another host and port on the network"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|