查看状态: systemctl status firewalld 或firewall-cmd --state
开启:systemctl start firewalld.service
centos7停止防火墙/关闭防火墙:systemctl stop firewalld.service
centos7重启防火墙:systemctl restart firewalld.service
设置开机启用防火墙:systemctl enable firewalld.service
设置开机不启动防火墙:systemctl disable firewalld.service
firewall-cmd --zone=public --add-port=80/tcp --permanent
–add-port=80/tcp #添加端口,格式为:端口/通讯协议
多个端口:firewall-cmd --zone=public --add-port=80-90/tcp --permanent
centos7查看防火墙所有信息:firewall-cmd --list-all
centos7查看防火墙开放的端口信息:firewall-cmd --list-ports
删除:firewall-cmd --zone=public --remove-port=80/tcp --permanent