iptables:如何删除后路由规则? [关闭]

Posted

技术标签:

【中文标题】iptables:如何删除后路由规则? [关闭]【英文标题】:iptables: how to delete postrouting rule? [closed] 【发布时间】: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

有什么问题吗?

【问题讨论】:

【参考方案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 起作用了

以上是关于iptables:如何删除后路由规则? [关闭]的主要内容,如果未能解决你的问题,请参考以下文章

iptables详解

iptables Drop Policy 将删除我的接受规则 [关闭]

怎样删除iptables规则

求助,如何完全删除IPTABLE规则

如何彻底清除iptables或者删除任何iptables的规则

linux查看防火墙规则的命令