1
我有一些网络过滤规则是这样的:iptables:如何轻松组织链中的规则?
iptables -I INPUT -j NFQUEUE -p udp --dport 4444
iptables -t mangle -I INPUT -j MARK --set-mark 100 -p udp --dport 4444
iptables -I OUTPUT -j NFQUEUE -p udp --sport 4444
iptables -t mangle -I OUTPUT -j MARK --set-mark 200 -p udp --sport 4444
我需要一个简单的方法,这组规则,目的是删除它们放在一起,这样
iptables -N MYCHAIN
iptables -I MYCHAIN -j NFQUEUE -p udp --dport 4444
iptables -t mangle -I MYCHAIN -j MARK --set-mark 100 -p udp --dport 4444
iptables -I MYCHAIN -j NFQUEUE -p udp --sport 4444
iptables -t mangle -I MYCHAIN -j MARK --set-mark 200 -p udp --sport 4444
# Fast deleting
iptables -F MYCHAIN
iptables -X MYCHAIN
但它没有工作,当然,我必须连接默认链与MYCHAIN,但我不知道如何。有更好还是更简单的解决方案?