Print Spooling using raw port 9100

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Print Spooling using raw port 9100
# 1  
Old 11-05-2009
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  
Old 11-09-2009
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.. Smilie

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  
Old 11-09-2009
Don't you love people who took the time to post their solutions to their problem even though nobody here helped?
# 4  
Old 11-09-2009
Excellent solution. Thank you for posting it.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

2. Shell Programming and Scripting

Error during spooling

Hi, I am extracting the records of a table from oracle into a csv file using spool command in unix script. I retrieve the error message as msgcnt 18512 vxfs: mesg 001: vx_nospace - /dev/vg02/lvol12 file system full (1 block extent) How to resolve it ? (4 Replies)
Discussion started by: sabural
4 Replies

3. Shell Programming and Scripting

Spooling file to excel

Hi , Im spooling file from oracle to csv using shell script. Below is the code im using.. The o/p is not coming in right format.. Please help me out in this.. O/p is coming as header till batch id ,im not able to see date_stored,type,type1.. Please any one can give me some suggestion ... (1 Reply)
Discussion started by: jkumsi
1 Replies

4. IP Networking

Creating a printer emulator to capture PDL/PCL data coming in on port 9100.

I have a number of Windows CE operator terminals. They have facility to print alarms/messages to ... aser or Inkjet (so they're using PCL). USB or IP. IP connection takes just the IP address. Question How could I create a service or daemon on a server to capture all this data?... (7 Replies)
Discussion started by: transistor
7 Replies

5. Shell Programming and Scripting

spooling through shell script

Hi, I want to spool the output from a .sql file to a .txt file through shell script. the contents of .sql are: spool /arboru02/scripts/customer_profile_def.txt select profile_id ||','|| account_no from customer_profile_def; spool off exit and shell scrip is like: #!/bin/sh... (9 Replies)
Discussion started by: ss_ss
9 Replies

6. Shell Programming and Scripting

spooling

hi, can anyone help me with spool command.. i want to spool a file.. i am getting the output of an sql query into a file in the unix environment.. i want to spool the contents of this file to create a .lst file.. as of now, i am giving it like - sql.sql : spool on select... (4 Replies)
Discussion started by: kripssmart
4 Replies

7. UNIX for Dummies Questions & Answers

Any way to direct print job to a non-standard port?

Hello. I've been asked to add a few network print queues to our HP-UX box but they're not really destined for a printer. They're going to an Interface Engine queue (also Unix based I believe...) listening on ports in the 7000 range not the standard 9100, 9101, etc... printer ports. Couldn't find a... (0 Replies)
Discussion started by: HVHS_CJR
0 Replies

8. UNIX for Advanced & Expert Users

HP-UX lp spooling places

Does anybody know if HP-UX uses any other directories besides /var/spool/lp/request to spool print jobs? I checked the man pages, and it only mentions /var/spool/lp in general. I was just wondering if anyone knew of some other place it might possibly use. thanks in advance for any help! (2 Replies)
Discussion started by: doeboy
2 Replies
Login or Register to Ask a Question