Testing Print Server Functionality In RHEL 6


Configuring a Print Server is quite easy in RHEL 6 but testing a remote printer can quite be a pain since we don’t have access to the printer & there’s no way to tell if the print job was successful or not, unless & until we see the print coming out 😦

So, what if we need to immediately know if the configuration is correct or not?

Below is what I did to reliably ascertain the correct configuration. It was not my idea, but implementation was completely mine 😉 So I can take some credit here 😉

My approach was to capture the network packets being sent to the printer port 9100. So, below is what I did. I captured all the packets aimed for port 9100 on NIC bond0.157. All the packets were then dumped to a text file.

tcpdump -i bond0.157 port 9100 -w ~shashank/tcpdump.txt

Next step was to read the captured packets.

tcpdump -tttt -r ~shashank/tcpdump.txt

-tttt means (from its man page!) – Print a timestamp in default format proceeded by date on each dump line.

So below are the contents of captured packets (when print requests were fired) that say some data was sent to the printer (192.168.0.1) which confirm the successful configuration. 🙂

2015-02-12 10:53:18.899254 IP 192.168.0.1.jetdirect > server.shashank.com.56306: Flags [.], ack 30, win 17490, options [nop,nop,TS val 100587393 ecr 1095159280], length 0
2015-02-12 10:53:18.899277 IP server.shashank.com.56306 > 192.168.0.1.jetdirect: Flags [P.], seq 30:36, ack 1, win 115, options [nop,nop,TS val 1095159284 ecr 100587393], length 6
2015-02-12 10:53:18.899296 IP server.shashank.com.56306 > 192.168.0.1.jetdirect: Flags [P.], seq 36:72, ack 1, win 115, options [nop,nop,TS val 1095159284 ecr 100587393], length 36
2015-02-12 10:53:18.899297 IP server.shashank.com.56306 > 192.168.0.1.jetdirect: Flags [P.], seq 72:108, ack 1, win 115, options [nop,nop,TS val 1095159284 ecr 100587393], length 36

P.S. – When configuration was incorrect, 0 bit length packets were received.

Advertisements

One thought on “Testing Print Server Functionality In RHEL 6

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s