删除已经创建的iptables(防火墙)规则

技术分享 2015-02-17

首先使用 iptables -L -n 命令来查看已经创建的防火墙规则,

[root@webxn ~]# iptables -L -n

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
DROP       all  --  173.231.17.71        0.0.0.0/0
DROP       all  --  173.231.17.71        0.0.0.0/0
ACCEPT     all  --  173.252.192.205      0.0.0.0/0
DROP       all  --  173.252.192.205      0.0.0.0/0
DROP       all  --  173.252.192.205      0.0.0.0/0
ACCEPT     all  --  173.252.192.205      0.0.0.0/0
DROP       all  --  173.252.192.205      0.0.0.0/0

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

我们可以看到我创建了很多规则. 然后我们可以使用命令:

iptables -D INPUT *

来删除制定规则, 比如我们删除第一行的规则, 那我们就可以执行:

iptables -D INPUT 1

就可以了.

评论 (0)

发表评论

最多500字符

验证码

暂无评论

成为第一个评论的人吧!