RECOMMENDED ARTICLES
IP FORWARDING using NAT with IPTABLES
In this example:
- we have a LAN connected to eth0 interface.
- our LAN connects to Internet via ppp0 interface.
- we mask our local lan IP addresses using NAT.
NAT stands for Network Address Translation.
In the console we write these commands:
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# iptables -A FORWARD -i eth0 -j ACCEPT
# echo 1 > /proc/sys/net/ipv4/ip_forward
References:
$ man iptables