我有一个链附加了许多规则,如:
> :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.