Friday, October 7, 2011

NAT Router on Linux

1- Enable Packet forwarding for IPv4 via /etc/sysctl.conf, by uncommenting the following line:
net.ipv4.ip_forward=1
2- Add the following lines to the bottom of /etc/rc.local:
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o eth0 -j MASQUERADE
Taking into consideration that eth0 is the interface connected to the internet.

No comments:

Post a Comment