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

首先使用 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

就可以了.

本文为原创文章,转载请注明出处。

原文链接:https://850406.xyz/post/删除已经创建的iptables-防火墙-规则

评论(0)

还没有评论,来抢沙发吧~

验证码