centos7 Failed to start iptables.service: Unit not found 防火墙

服务器   发布日期:2025年06月11日   浏览次数:303

在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理

添加

firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent 

重新载入

firewall-cmd --reload

查看

firewall-cmd --zone=public --query-port=80/tcp

删除

firewall-cmd --zone=public --remove-port=80/tcp --permanent

开启防火墙

systemctl start firewalld.service

关闭防火墙

systemctl stop firewalld.service

查看运行状态

firewall-cmd --state //running 表示运行

  

 

 

 

 

 

 

以上就是centos7 Failed to start iptables.service: Unit not found 防火墙的详细内容,更多关于centos7 Failed to start iptables.service: Unit not found 防火墙的资料请关注九品源码其它相关文章!