2004.5.18晚实验成功内网PC做Lockon主机,环境如下:
PPPoe拨号后公网IP:218.61.11.190
------------------------------------------------------------------
ADSL_Modem====>eth1_[iptables]_eth0=========>PC
ppp0----->eth1->eth0(192.168.1.254)---->192.168.1.5
------------------------------------------------------------------
------iptables关键规则如下:-----------------------------------------------------------------------
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o ppp0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -d 218.61.11.190 --dport 10308 -j DNAT --to 192.168.1.5:10308
iptables -t nat -A PREROUTING -p udp -d 218.61.11.190 --dport 10308 -j DNAT --to 192.168.1.5:10308
iptables -A FORWARD -p tcp -d 192.168.1.5 --dport 10308 -o eth0 -j ACCEPT
iptables -A FORWARD -p udp -d 192.168.1.5 --dport 10308 -o eth0 -j ACCEPT
---------------------------------------------------------------------------------------------------
------ipchains关键规则如下:-----------------------------------------------------------------------
ipchains -P forward DENY
ipchains -A forward -s 192.168.1.0/24 -d 0/0 -j MASQ
ipmasqadm portfw -a -P tcp -L 218.61.11.190 10308 -R 192.168.1.5 10308
ipmasqadm portfw -a -P udp -L 218.61.11.190 10308 -R 192.168.1.5 10308
---------------------------------------------------------------------------------------------------
公网多人联机成功
[此贴子已经被作者于2004-5-19 23:20:01编辑过]
|