折腾linux iptables的时候,看着教程插入了几条INPUT规则,最后一条是drop all
比如这样:
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:80
2 DROP all -- anywhere anywhere
然后接着装其他东西需要开端口的时候没有注意,用的增加规则而不是插入规则,这样新增加的规则就到了drop all 规则后面,如下:
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:80
2 DROP all -- anywhere anywhere
3 ACCEPT tcp -- anywhere anywhere tcp dpt:100
造成后加入的规则无效,本来想找找看有没有命令吧在中间的drop all 规则挪到最后,找了半天发现没有
然后就蛋疼的删除了drop all 然后增加drop all达到了想要的效果
但是这样实在是不太方便,如果我后面还要增加规则呢?
请教一下有没有命令直接将两条规则调换位置.
比如这样:
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:80
2 DROP all -- anywhere anywhere
然后接着装其他东西需要开端口的时候没有注意,用的增加规则而不是插入规则,这样新增加的规则就到了drop all 规则后面,如下:
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:80
2 DROP all -- anywhere anywhere
3 ACCEPT tcp -- anywhere anywhere tcp dpt:100
造成后加入的规则无效,本来想找找看有没有命令吧在中间的drop all 规则挪到最后,找了半天发现没有
然后就蛋疼的删除了drop all 然后增加drop all达到了想要的效果
但是这样实在是不太方便,如果我后面还要增加规则呢?
请教一下有没有命令直接将两条规则调换位置.