Activate Routing NAT Linux

Wan eth0, Lan eth1

type :

echo 1 > /proc/sys/net/ipv4/ip_forward

and :

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT

This entry was posted in IT, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *