Hi!请登陆

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

2020-10-27 53 10/27

首先使用 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
[root@webxn ~]# iptables -h
iptables v1.3.5

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

iptables -D INPUT *

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

iptables -D INPUT 1

就可以了.

Tag:

相关推荐