The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
spooling through shell script ss_ss Shell Programming and Scripting 9 01-13-2009 11:14 AM
spooling kripssmart Shell Programming and Scripting 4 06-18-2008 09:02 AM
Any way to direct print job to a non-standard port? HVHS_CJR UNIX for Dummies Questions & Answers 0 05-08-2006 03:32 PM
Spooling a log file with timestamp ukadmin UNIX for Dummies Questions & Answers 2 03-23-2004 09:06 AM
HP-UX lp spooling places doeboy UNIX for Advanced & Expert Users 2 04-10-2002 12:21 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 2 Weeks Ago
ZekesGarage ZekesGarage is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 8
Print Spooling using raw port 9100

Hello all,
I need to setup a print server that listens on three separate network interfaces, and sends jobs to the corresponding print queue. Example:

192.168.69.100 - printer1 -> Out to 139.177.69.100:9100
192.168.69.101 - printer2 -> Out to 139.177.69.101:9100
192.168.69.102 - printer2 -> Out to 139.177.69 102:9100

Is there a way to have the printing system listen on a specific interface for a queue?

Also can I have the queue listen on port 9100 and just spool the raw data to be sent on to the printer?

The system I'm going to use is a RHEL5 system, but I can make it anything if I so desire.

The issue deals with a client application that can't be touched and currently prints directly to an HP jetdirect server. We are moving some infrastructure and due to some security directives, I'm required to build this intermediate box to spool the data, rather than just routing these jobs through the firewalls. (I've already fought the logic on this and lost, so don't get me started again :-))

Any insight is appreciated.

Shawn
  #2 (permalink)  
Old 1 Week Ago
ZekesGarage ZekesGarage is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 8
Fixed my own issue

Found the solution to my problem, and thought I would post it in case I forget it and have to look it up again..

Since the customer application was setup to print to 4 individual printers, using 4 different IP addresses, I had the network folks re-map the NATting to point to aliases created on my print queue box. So I created the network aliases on my primary interface, giving me:

eth0 Link encap:Ethernet HWaddr 00:24:E8:67:E9:85
inet addr:172.19.2.56 Bcast:172.19.2.63 Mask:255.255.255.224
inet6 addr: fe80::224:e8ff:fe67:e985/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:68965 errors:0 dropped:0 overruns:0 frame:0
TX packets:77371 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:26198783 (24.9 MiB) TX bytes:35977262 (34.3 MiB)
Interrupt:169 Memory:f8000000-f8012100

eth0:1 Link encap:Ethernet HWaddr 00:24:E8:67:E9:85
inet addr:172.19.2.57 Bcast:172.19.2.63 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Memory:f8000000-f8012100

eth0:2 Link encap:Ethernet HWaddr 00:24:E8:67:E9:85
inet addr:172.19.2.58 Bcast:172.19.2.63 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Memory:f8000000-f8012100

eth0:3 Link encap:Ethernet HWaddr 00:24:E8:67:E9:85
inet addr:172.19.2.59 Bcast:172.19.2.63 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:169 Memory:f8000000-f8012100


Next was to create the print queues and point them to the HP printers to be serviced. I called them 'printer1' 'printer2' and so on.. (I cheated and did this with Webmin):
[root@ndh1-dmz-ptq ~]# lpstat -a
printer1 accepting requests since Sat 07 Nov 2009 12:30:10 PM EST
printer2 accepting requests since Sat 07 Nov 2009 12:30:14 PM EST
printer3 accepting requests since Sat 07 Nov 2009 12:30:18 PM EST
printer4 accepting requests since Sat 07 Nov 2009 12:30:22 PM EST
[root@ndh1-dmz-ptq ~]#


Verified the existence of the JetDirect service in /etc/services on port 9100:
jetdirect 9100/tcp laserjet hplj #

Installed xinetd on the RHEL 5 system and created a new file in /etc/xinetd.d/ for each print queue that I wanted to setup. Remember to change the name of the print queue and the IP address to be listened to using the BIND flag. This one is called /etc/xinetd.d/printer1:

# Allow applications using the AppSocket / JetDirect protocol
# to communicate with CUPS.
service jetdirect
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/bin/lp
server_args = -d printer1 -o raw
groups = yes
disable = no
bind = 172.19.2.56
}


Then I just created 3 more files (one for each printer), restarted xinetd:
service xinetd restart
And check netstat for listeners:
netstat -a|more:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 ndh1-dmz-ptq.:2208 *:* LISTEN
tcp 0 0 172.19.2.59:jetdirect *:* LISTEN
tcp 0 0 172.19.2.58:jetdirect *:* LISTEN
tcp 0 0 172.19.2.57:jetdirect *:* LISTEN
tcp 0 0 172.19.2.56:jetdirect *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:ndmp *:* LISTEN


After this we just had to ensure all firewall rules allowed port 9100 traffic to flow in and out, and we were up and printing.



Shawn
  #3 (permalink)  
Old 1 Week Ago
binlib binlib is offline
Registered User
  
 

Join Date: Aug 2009
Location: New Jersey
Posts: 56
Don't you love people who took the time to post their solutions to their problem even though nobody here helped?
  #4 (permalink)  
Old 1 Week Ago
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
Excellent solution. Thank you for posting it.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0