使用命令的方式配置CentOS7防火牆
##Add
firewall-cmd --permanent --zone=public --add-port=80/tcp
##Remove
firewall-cmd --permanent --zone=public --remove-port=80/tcp
##Reload
firewall-cmd --reload
復制代碼
檢查是否生效
firewall-cmd --zone=public --query-port=80/tcp
列出所有的開放端口
firewall-cmd --list-all
查看防火牆狀態
systemctl status firewalld.service
啟動防火牆
systemctl start firewalld.service
關閉防火牆
systemctl stop firewalld.service
重新啟動防火牆
systemctl restart firewalld.service
http://xxxxxx/Linuxjc/1135400.html TechArticle