NAT with iptables

From wiki.network-crawler.de
Jump to: navigation, search

Howto nat from your ethernet device to your computer with your favorite port.

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 6112 -j DNAT --to-destination 192.168.1.3
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.1.3 --dport 6112 -j ACCEPT

In this case you nat from your ppp0 to 192.168.1.3 from port 6112 (Battlenet)