Saturday, July 20, 2013

Configure NAT in Linux


NAT stand for Network address translation that allows you to use private ip address to access public network , because NAT translate private ip address in to public ip address. This also ensure your network security from hackers by hiding your actual IP information..
dixitmicro.blogspot.com
Simple NAT LAN Setup

Use the following rule to implement NAT for the internal network to update iptable.
# iptables -t nat -I POSTROUTING -o eth0 -s 10.8.8.0/24 -j MASQUERADE
(-t means table, -o means output interface, -s means source address. I am using classless ip).
Then restart iptable servcie by using following commands.
# service iptables restart
# service iptables save

Make the following change to the kernel: to forward LAN routing.
# echo 1 > /proc/sys/net/ipv4/ip_forward
OR use persistent
#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
Where 0 means LAN routing is disabled.
Now go to Private client end and configure ip address and try to open any public site it should be open.

No comments:

Post a Comment