FreeNAS As A Print Server
FreeNAS As A Print Server
step 1Preparation
First, let's get together a few things and take a look at the setup.
The Network
Your setup may be different, but mine is as follows.
- Linksys WRT54GL router running Tomato firmware v1.23
- FreeNAS box - v0.69, old Sony Vaio, 2 hard drives, static IP: 192.168.1.50
- PC - Windows XP SP3
- Macbook Pro - OSX 10.5.6
- HP Deskjet 6540 - USB connected printer, attached to FreeNAS
You will need to assign your FreeNAS box a static internal IP from within your router. There's plenty
of guides online for that, all straight-forward, so do a quick Googling.
PuTTy is pretty self explanatory here for connecting. For the command line people, type:
You should now have yourself a little greeting and a new command prompt (loggin in as root
is freenas:~# and as a user is > )
step 3Put ulpt.ko In The Right Spot
Use your preferred method (ftp, smb, etc.) to put the ulpt.ko file somewhere onto the FreeNAS box,
and remember the full path (I'll call it UPath), which will probably be something
like /mnt/drivename/ulpt.ko
Go back to the terminal with the SSH connection and command prompt, we're going to move the file
to the proper place. Type:
mv Upath /boot/kernel/ulpt.ko
pkg_add -r LPRng
Let that chug away for a bit while it downloads and installs the necessary bits.
nano /boot/defaults/loader.conf
Scroll down with either the arrow keys or ctrl+V until you reach a section titled "USB Modules"
Change the line
"ulpt_load="NO " # Printer"
to
"ulpt_load="YES " # Printer"
Hit ctrl+X. Then type "y", and hit enter when it asks you to save.
Start LPRng
Name: lpd_enable
Value: NO
Name: lprng_enable
Value: YES
Step 6LPRng Configuration: 1 of 3 - printcap
There are three main files that contribute to LPRng working properly.
- /etc/printcap
- /usr/local/etc/lpd.perms
- /usr/local/etc/lpd.conf
Printcap (location: /etc/printcap) can be very complex or very simple. We'll go with very simple, but
you can refer to the LPRng site and google for some different setups depending on your needs.
First line doesn't matter much. Just put your printer make/model in there for reference
- "lp|deskjet" - this is what you're printer will be known as. "lp" is the primary name, "deskjet" is an
alias.
- "sd=" This is the path to the print spooler. We're going to make this directory in a second.
- "sh" This stands for "supress header". If you've ever printed in a computer lab, you'll have seen
these. It's a page that prints before a job that identifies who the job is for. For most people at home,
it's unnecessary. In a work environment with lots of people and printing, it's something you should
look into.
- "lp=" this is the location of the printer. If ulpt.ko loads properly, then when you connect a printer, it
should register as /dev/ulpt0.
Remember the spooler path from sd? Let's make it. Type:
This creates the proper directory with the necessary ownership and permissions.
nano /usr/local/etc/lpd.perms
"nano /usr/local/etc/devd/devd.conf"
This watches for the printer to be plugged in, waits a few seconds, and starts the LPD process. Once
that's going it fixes any missing files or permissions with checkpc -f . It then sets proper ownership
and permissions on the device and plays a little sound.
2) Go to the Control Panel and then to Printers. Run the Add a New Printer wizard.
5) Enter the IP address of the FreeNAS box. This is why we want it to be static. Enter the name of the
print queue (if you copied my printcap, it's "lp" without quotes)
6) Install drivers and click through the rest of the wizard. Do not print test page.
9) Advanced Tab.
start printing after the last page is spooled. Check
Print directly& Uncheck
Hold mismatched& Uncheck
Print spooled& Check
Keep&.Uncheck
Enable advanced& Check
10) Now go back to the main tab and try printing a test page.
step 11Connecting with Mac OSX
1) Open up System Preferences -> Print and Fax
*Some printers, like my HP Deskjet 6540 wouldn't let me use the usb drivers with the LPD. I had to
instead pick one as close as possible (turned out to be 5550) and go with that. If the two models are
similar, it should work without a problem.