« IP Tables | Main | Smoked router »

Printing on home LAN via internet

A bit of trickery to print to a printer on my home LAN via the internet. The example below assumes the printer is being connected to externally on port 12345, and actually accepts connections on port 9100 (HP Jet Direct).

Tested and working, but may not be perfect. OS X wasn't able to identify the printer model automatically, but setting this manually let the jobs print normally.


# Printer
iptables -t nat -A prerouting_rule -d $WANIP -p tcp --dport 12345 -j DNAT --to 192.168.1.99:9100
iptables -A forwarding_rule -d 192.168.1.99 -p tcp --dport 9100 -j ACCEPT
iptables -t nat -A postrouting_rule -o $LAN -p tcp -s $network -d 192.168.1.99 -m multiport --dports 9100 -j SNAT --to-source $WANIP

TrackBack

TrackBack URL for this entry:
http://www.wrightthisway.com/cgi-bin/mt/mt-tb.cgi/392

About

This page contains a single entry from the blog posted on June 8, 2007 9:45 PM.

The previous post in this blog was IP Tables.

The next post in this blog is Smoked router.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33