Printer Sharing

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:36, 5 February 2007 (edit)
Lodp (Talk | contribs)
(Print server)
← Previous diff
Revision as of 02:08, 15 February 2007 (edit) (undo)
Whiteboy (Talk | contribs)

Next diff →
Line 1: Line 1:
-Install [[ USB | USB support]] (usb_storage, sd_mod etc. can be left out if no need for external storage).+DD-WRT allows for clientless printer sharing making it easy to install printers directly into the router without the need for a seperate computer. You must have installed [[ USB | USB support]] (usb_storage, sd_mod etc. can be left out if no need for external storage).
==Printer driver== ==Printer driver==
- 
Install printer driver: Install printer driver:
Line 24: Line 23:
==Print server== ==Print server==
- 
Now Install printserver daemon: Now Install printserver daemon:
Line 45: Line 43:
==Workstation setup== ==Workstation setup==
- 
Windows XP: Windows XP:
Find your printer in Control Panel - Printers etc. and open the properties page for it. Select the Ports tab. Find your printer in Control Panel - Printers etc. and open the properties page for it. Select the Ports tab.
Line 54: Line 51:
Click Next and Finish and Close Click Next and Finish and Close
Make sure the newly created port is selected for your printer and click OK Make sure the newly created port is selected for your printer and click OK
- 
-That's it 
==Printing from WAN== ==Printing from WAN==
- 
If you want to be able to print from the WAN side of your router do the following: If you want to be able to print from the WAN side of your router do the following:
Line 70: Line 64:
NOTE: This is not recommended if your WAN is directly accessible from internet, but useful at private subnets of companies, colleges etc. NOTE: This is not recommended if your WAN is directly accessible from internet, but useful at private subnets of companies, colleges etc.
- 
-[[Category:advanced HOWTO]] 
[[Category:English documentation]] [[Category:English documentation]]
 +[[Category:Advanced tutorials]]

Revision as of 02:08, 15 February 2007

DD-WRT allows for clientless printer sharing making it easy to install printers directly into the router without the need for a seperate computer. You must have installed USB support (usb_storage, sd_mod etc. can be left out if no need for external storage).

Contents

Printer driver

Install printer driver:

 ipkg install kmod-usb-printer

Edit /jffs/etc/config/usb.startup and add

 insmod /jffs/lib/modules/2.4.30/printer.o

Connect printers and reboot your router

See if any printers have been found:

 dmesg | grep usb

It should show something like this (I have 2 printers connected)

 <6>printer.c: usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x04F9 pid 0x000D
 <6>printer.c: usblp1: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x04A9 pid 0x108C

usblp0 means that the found printer is accessible at /dev/usb/lp0 etc.

Print server

Now Install printserver daemon:

 ipkg install p910nd

Edit /jffs/etc/config/usb.startup and add

 #brother laser
 /jffs/usr/sbin/p910nd -b -f /dev/usb/lp0 0
 #canon inkjet
 /jffs/usr/sbin/p910nd -b -f /dev/usb/lp1 1

(correct the above to match your setup)

-b means bidirectional, -f specifices device name, and the last number can be 0,1 or 2, making the print server listen at port 9100, 9101 and 9102 respectively.

Reboot your router

Now, you router works as a print server over TCP/IP

Workstation setup

Windows XP: Find your printer in Control Panel - Printers etc. and open the properties page for it. Select the Ports tab. Click Add Port and choose Standard TCP/IP printer port and click New Port Enter you router's IP address (normally 192.168.1.1) and click Next Set Device type to custom and click settings. Make sure RAW is selected and specify the necessary port number (normally 9100) and click OK Click Next and Finish and Close Make sure the newly created port is selected for your printer and click OK

Printing from WAN

If you want to be able to print from the WAN side of your router do the following:

In the web interface go to Administration - Commands and hit the "Command shell" field and type in

 /usr/sbin/iptables -I INPUT 1 -p tcp --dport 9100:9102 -j logaccept

And click Save Firewall

Your router reboots and you can now print from WAN side

NOTE: This is not recommended if your WAN is directly accessible from internet, but useful at private subnets of companies, colleges etc.