由 oyzjin 在 09-20-2004 11:44 发表:
大家帮忙看一下这两句iptables有什么不同
iptables -t nat -A PREROUTING -i eth0 -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 800
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 800
第二句成功实现目的,第一句不行。以下是-L的输出:
第一句:
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere elas tcp dpt:http redir ports 800
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
第二句:
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 800
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
k7_550 asus_kx133 win98 winnt
c433 810 redhat9.01 23G_scsi128m
由 oyzjin 在 09-20-2004 11:52 发表:
我想知道为什么加了-d localhost反而不行,用本机IP,127。0。0。1都不行,把它删了成功。怪!!!!
换成-d localhost -p tcp -m tcp也不行,总之就是多了-d localhost就怎样都不行,不明…………………………
k7_550 asus_kx133 win98 winnt
c433 810 redhat9.01 23G_scsi128m
由 Snoopy 在 09-20-2004 17:31 发表:
听不清楚你的意思 ?? 检查你的/etc/hosts
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 oyzjin 在 09-24-2004 22:59 发表:
iptables -t nat -A PREROUTING -i eth0 -d localhost -p tcp --dport 80 -j REDIRECT --to-ports 800
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-ports 800
想知道这两句有什么分别,HOST无问题的
我也改过了,现在WIN下,明天再查
谢谢