【问题标题】:iptables: how to delete postrouting rule? [closed]iptables:如何删除后路由规则? [关闭]
【发布时间】:2012-01-04 13:25:48
【问题描述】:

我想删除下面的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         

然后我在下面输入,

[root@hostname ~]# iptables -D POSTROUTING 1
iptables: No chain/target/match by that name

有什么问题吗?

【问题讨论】:

    标签: iptables


    【解决方案1】:

    尝试显式添加表名:

    iptables -t nat -D POSTROUTING 1
    

    【讨论】:

    • “是必要的”——你的意思是“没有必要”吗?或者这是否解决了您的问题?
    • 对不起,我打错了。感谢您的建议,这解决了我的问题!非常感谢!
    • 太棒了! Don't forget to accept this as the answer,以便将来可以帮助其他人。谢谢!
    • 哦,我终于找到了我一直在寻找的东西,非常感谢您的回答!几个小时以来一直在搞乱我的 iptables 配置,当我试图删除一个非常错误的规则时,我总是错过了 -t nat 部分。上帝祝福你! +++
    • 这对我自己 Ubuntu 13.04 不起作用(可能是我自己的行为),但 iptables -t nat -F 起作用了
    猜你喜欢
    • 2012-04-29
    • 2014-01-30
    • 1970-01-01
    • 2016-01-09
    • 1970-01-01
    • 2016-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多