If you got two network interface on Linux box then it is easy job:
Run two commands first,
Code:
echo 1 >/proc/sys/net/ipv4/tcp_syncookies
echo 1 > /proc/sys/net/ipv4/ip_forward
Note you can setup above two in /etc/sysctl.conf so that they will continue after linux reboot
Code:
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
Assuming that on linux box eth0 is connected to the internet and eth1 is connected to a private LAN:
Code:
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
iptables --append FORWARD --in-interface eth1 -j ACCEPT
if it is ppp stuff (dial up) internet then ONLY use following and not ABOVE,
Code:
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT - Assuming one NIC to local LAN
It can't get easier than this