Back-end server NAT shared Internet access
Gateway Server Extranet IP eth0:10.0.0.1
eth1:192.168.1.1
1. Turn on forwarding on the gateway server
Sysctl-p
grep "Net.ipv4.ip_forward = 0"/etc/sysctl.conf
Sed-i ' S/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g '/etc/sysctl.conf
Sysctl-p
2. Set NAT translation for Gateway server iptables
/etc/init.d/iptables stop
/sbin/iptables-t nat-a postrouting-o eth0-s 192.168.1.0/24-j Masquerade
3. The backend LAN server needs to be online, the intranet IP needs to be set to 192.168.1.0/24 network segment IP. Also set the gateway IP to connect to the Gateway server intranet interface IP is 192.168.1.1
Ifconfig eth0 192.168.1.100/24 up
Route add default GW 192.168.1.1
This article is from the "Technology Change Destiny" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1697350
Back-end server NAT shared Internet access