iptables:如何删除postrouting规则?

hir*_*roo 37 iptables

我想删除下面的POSTROUTING规则,

[root@hostname ~]# service iptables status
Table: nat
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination         

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination         
1    MASQUERADE  all  --  192.168.1.0/24       0.0.0.0/0           

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         
Run Code Online (Sandbox Code Playgroud)

然后我输入下面,

[root@hostname ~]# iptables -D POSTROUTING 1
iptables: No chain/target/match by that name
Run Code Online (Sandbox Code Playgroud)

有什么不对的吗?

sar*_*old 70

尝试显式添加表名:

iptables -t nat -D POSTROUTING 1
Run Code Online (Sandbox Code Playgroud)

  • 表名是必要的...... (5认同)
  • 这对我自己的Ubuntu 13.04(可能来自我自己的做法)不起作用,但```iptables -t nat -F```做了 (3认同)