linux ?μí3μ±?·óéà′ó?μ?ì??t:
1?¢?áéù2?éí??¨
2?¢?????·óé±í
3?¢?a??IP forward 1|?ü
?2ì??·óéμ?????·?ày:
route add -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1
route del -net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1
route add default gw 172.16.1.1
route del default gw 172.16.1.1
route ?üá?ìí?óμ??·óé,?μí3????oó?á??ê§,?éò?????ìí?óμ????t
/etc/sysconfig/static-routes ?D£?ó?·¨è???£o
í??¨??3? net/host ??±êí????ò?÷?ú netmask ?ú?? gw í?1?
è?£o
eth0 net 192.168.1.0 netmask 255.255.255.0 gw 172.16.1.1
?ò??route add ?üá??óμ?
/etc/rc.d/rc.local
???t?D
?a??IP forward 1|?ü:
1?¢vi /etc/sysctl.conf
net.ipv4.ip_forward=1
2?¢vi /etc/sysconfig/network
FORWARD_IPV4=yes
3?¢service xinetd reload
iptables nat ·?ày£o
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 172.16.3.5
iptables -t nat -A PREROUTING -p tcp -d 172.16.3.5 --dport 8080 -j DNAT --to 192.168.1.1:80
----------
service iptables save