linux – 使用所有规则删除iptables链

我有一个链附加了许多规则,如:

> :i_XXXXX_i - [0:0]
> -A INPUT -s 282.202.203.83/32 -j i_XXXXX_i 
> -A INPUT -s 222.202.62.253/32 -j i_XXXXX_i 
> -A INPUT -s 222.202.60.62/32 -j i_XXXXX_i 
> -A INPUT -s 224.93.27.235/32 -j i_XXXXX_i 
> -A OUTPUT -d 282.202.203.83/32 -j i_XXXXX_i 
> -A OUTPUT -d 222.202.62.253/32 -j i_XXXXX_i 
> -A OUTPUT -d 222.202.60.62/32 -j i_XXXXX_i 
> -A OUTPUT -d 224.93.27.235/32 -j i_XXXXX_i

当我尝试删除此链时:

iptables -X XXXX

但得到了错误(尝试iptables -F XXXXX之前):

iptables: Too many links.

是否有一种简单的方法可以通过一次命令删除链?

解决方法

当带有’-j CHAINTODELETE’的规则引用它们时,您无法删除链.弄清楚什么是引用您的链(链接),并删除它.另外,冲洗然后杀死.

-F,–flush [chain]

Flush the selected chain (all the chains in the table if none is given). This is equivalent to deleting all the rules one by one.

-X,–delete-chain [chain]

Delete the optional user-defined chain specified. There must be no references to the chain. If there are,you must delete or replace the referring rules before the chain can be deleted. The chain must be empty,i.e. not contain any rules. If no argument is given,it will attempt to delete every non-builtin chain in the table.

dawei

【声明】:淮南站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。