Set up Network Address Translation

From Linuxintro
Revision as of 19:57, 14 July 2012 by imported>ThorstenStaerk

To set up NAT (network address translation), open a console and

  • allow IP traffic forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
  • tell the kernel to forward traffic to the outgoing interface eth0 and masquerade it, so it will put its own IP address into each packet's header:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

See also