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


在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 表示运行

  

 

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM