【发布时间】:2017-05-19 16:36:31
【问题描述】:
我在 iptable 中添加了数据包转发规则sudo iptables -t nat -A PREROUTING -p tcp --dport 1111 -j DNAT --to-destination 10.0.3.126:80
我可以看到到达端口 1111 的数据包已正确转发到 10.0.3.126:80。但是,如果我列出规则,我看不到我添加的规则。
sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
如何查看我添加的规则? 提前谢谢你。
【问题讨论】:
-
sudo iptables-save
-
谢谢@MichaelO。