# First Load the ipchains kernel module . Required only if iptables is compiled as a module /sbin/modprobe iptables insmod iptables
# MASQ the full network /sbin/iptables -t nat -A POSTROUTING -j MASQUERADE
# List the rules /sbin/iptables -L
This would look after all the entire data traffic from the local network to the internet.
Finally add this to the startup -
$ vi /etc/rc.local Add the line /etc/rc.d/init.d/rc.fw
This ensures that the settings are retained after a reboot also.
After rebooting the server would do all the routing functions for the entire network.
On the client side all that is required is to set the default router/gateway as the server's IP i.e. 192.168.1.1. The entire network is now set to share the internet connection.
Amarjyoti Krishnan heads bobcares.com, a tech support company for webhosts and ISPs. He is the co-founder of Poornam Info Vision Ltd., a software and IT services company which specializes in Linux based solutions for Webhosts and ISPs. Poornam Info Vision is an ISO 9001:2000 certified company with a team of over 100 engineers.
Amarjyoti is a Computer Engineer based in India and has over 7 years of experience in the hosting industry. He has spoken and written extensively on the subject. His articles have been published both online as well as in print in magazines.