Here are some simple steps to do it, using Network Address Translation (NAT)
- Enable packet forwarding . Make it permanent by adding “net.ipv4.ip_forward = 1” to /etc/sysctl.conf
echo “1” > /proc/sys/net/ipv4/ip_forward
- Enable iptables to handle NAT. ( eth0 is the public connection )
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- Save iptables settings
service iptables save
- Done. Check by routing table by verifying “netstat -nr” and iptables rules by “iptables -L”
This is a simple method for Redhat Enterprise Linux. See iptables docs for more detailed info.
