|
|

楼主 |
发表于 2005-6-18 12:18:34
|
显示全部楼层
服务器一个网卡(eth0)Ip是172.28.2.195(教育网,后两位是假设的,非真实),另一个网卡(eth1)ip是59.57.219.185(电信,后两位是假设的),其他windows机器的教育网ip在172.28.2.193~254间,在服务器iptables里添加如下规则:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -A POSTROUTING -s 172.28.2.193/26 -o eth1 -j SNAT --to-source 59.57.219.185
/etc/rc.d/init.d/iptables save
/etc/rc.d/init.d/iptables restart
同时在/etc/rc.d/rc.local 里添加如下路由:
route add -net 202.120.0.0/16 gw 172.28.2.1
rotue add -net 202.192.0.0/12 gw 172.28.2.1
………………(还有一些,不列举了)
在shell下用route可以看到route 有运行,但不起作用。
恳请大家指教。 |
|