Nerdrium Home

Macintosh

Linux

Web Design

Case Mods

Gardening

Photography

Recipes

 

My Blog

 

Facebook

Twitter

Sharing an Old Printer

by Michael Greifenkamp (June 24th, 2004)

Well, I guess this could go into either Macintosh or Linux. Oh well.

My boss got rid of an old LaserJet 5L in favor of a newer model. He was having problems printing in Windows XP. Well, not being one to let equipment go to waste, I acquired the old printer, naively thinking that I'd hook it up to my G5. But duh--there's no USB connection on the printer. Then it occurred to me that I should be able to hook it up to my Linux box (a Dell) and print to it using CUPS.

I got lucky for the first part of this adventure--I shut down the Dell, plugged in the printer, and when I restarted good ol' RedHat knew what it was that I had plugged in. I was dreading having to wade into a mess of drivers and source files, etc. Nope!

The next step was to add the printer. Redhat Menu-->System Settings-->Printing. After clicking New Printer, I gave it a queue name of "LaserJet5L" (no spaces) and made it the default printer. RedHat saw the printer as a local printer and found the correct driver for it. Next I went to the Action menu and chose Sharing. I checked "This queue is available to other computers." Then in the General tab I checked "Enable LPD protocol."

Next up was the G5. I opened up the System Preferences and chose Print & Fax. I clicked the button Set Up Printers... For the type I chose LPD/LPR, I entered the IP address of the Linux box, and listed the queue name to match what I entered on the other machine, "LaserJet5L".

Of course, none of this works because of the firewall on the Linux box. So another hack of the iptables file is in order...

Ready? Prepare for root access....

cd /etc/sysconfig
cp iptables iptables.bak
vi iptables

Here's the line I added up in the ACCEPT part of the file:

-A RH-Lokkit-0-50-INPUT -p tcp -m tcp --dport 515 --syn -j ACCEPT

I saved that file, and then restarted the iptables daemon.

service iptables restart

(You should get four [ OK ] messages. If you get an error, immediately replace the backup iptables file that you made and restart the service again, otherwise your firewall is off. Then try adding that line again and be careful to type it exactly. If you still have problems, send me an e-mail...)

I fired up Word in OS X and, made a test page, and clicked Print and lo and behold, it came out of the LaserJet a few moments later. Unix is cool. :)

--Michael