- 论坛徽章:
- 0
|
回复 5# marsaber
谢谢您的回答:加上
iptables -X
iptables -t nat -F
iptables -t nat -X
ok,就通过了。
如下:
- ptables -F
- iptables -X
- iptables -t nat -F
- iptables -t nat -X
- iptables -P INPUT ACCEPT
- iptables -P FORWARD ACCEPT
- iptables -P OUTPUT ACCEPT
- /sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
- /sbin/iptables -t nat -A PREROUTING -p tcp -d 210.46.140.233 --dport 8000 -j DNAT --to-destination 192.168.0.17:80
复制代码 -----------------------------------
按二楼的说法加上
iptables -t nat -A POSTROUTING -p tcp -s 192.168.0.17 --sport 8000 -j SNAT --to 210.46.140.233:8000
也可以通过
如下:- iptables -F
- iptables -P INPUT ACCEPT
- iptables -P FORWARD ACCEPT
- iptables -P OUTPUT ACCEPT
- iptables -t nat -A POSTROUTING -p tcp -s 192.168.0.17 --sport 8000 -j SNAT --to 210.46.140.233:8000
- /sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
- /sbin/iptables -t nat -A PREROUTING -p tcp -d 210.46.140.233 --dport 8000 -j DNAT --to-destination 192.168.0.17:80
复制代码 -------------------------------------
能不能给我解释上为什么???
我的理解:
1.我的nat 有一些默认的内容 不知道对不对
对于这句话必须在加上为什么
iptables -t nat -A POSTROUTING -p tcp -s 192.168.0.17 --sport 8000 -j SNAT --to 210.46.140.233:8000
|
|