This script is help to set the NAT communicating with eth0(WAN) and eth1(LAN GW)

Example :
eth0: 203.123.123.123
eth1: 192.168.0.1

[root@~]# vi /root/natroute.sh
[root@~]# chmod 755 /root/natroute.sh

## This script is help to set the NAT ## communicating with eth0(WAN) and eth1(LAN GW) ## Set LAN subnet 192.168.0.0 route to gateway eth1 route add -host 255.255.255.255 dev eth1 route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 ## NAT Routing communiucate with eth echo "1" > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE

PS: You can add above code or "natroute.sh" in /etc/rc.local for automatic start NAT function after reboot.


Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.