Linux Gateway Nat

Sharing a internet connection from a wireless to a local net (ethernet)

Gateway basic configuration

sudo -s
echo "nameserver" >/etc/resolv.conf
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --flush
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
ifconfig eth0 up

Client basic configuration

ifconfig eth0 up
route add default gw
echo "nameserver" >/etc/resolv.conf
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.