当前位置:主页 > 服务器 > Linux >

Linux下防火墙的简单配置与插入规则介绍

时间:2021-07-22 07:46:46 | 栏目:Linux | 点击:

查看当前的防火墙设置

iptables -L INPUT -n --line-numbers 

删除一条策略,例如第4行策略

iptables -D INPUT 4

-A:在尾部插入

-I (insert)在指定链中插入一条新规则,为指明插入到第几行

(如:在第七行插入)

iptables -I INPUT 7 -p tcp -m state --state NEW -m tcp --dport 81 -j ACCEPT

然后保存

service iptables save

然后重启

service iptables restart

您可能感兴趣的文章:

相关文章