Centos7 防火墙默认使用firewall
查看防火墙状态
systemctl status firewalld.service
启动防火墙
systemctl start firewalld.service
关闭防火墙
systemctl stop firewalld.service
重启防火墙
systemctl restart firewalld.service
开放端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
重载防火墙规则
firewall-cmd --reload
查看防火墙开放的端口
firewall-cmd --zone=public --list-ports