我以 root 身份运行这两条规则,但是执行 iptables -L 时它没有显示任何规则,有人知道问题出在哪里吗?
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 --source 84.244.145.135 -j REDIRECT --to-port 1222
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 --source 243.134.97.194 -j REDIRECT --to-port 1222
duno@Virtual-Box:/home/glennwiz# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
答案1
您将它们添加到 nat talbe 中,默认情况下 iptables 会列出过滤表。要查看您添加的内容,请运行:
iptables -t nat -nL