1.查看防火墙服务状态
# systemctl status firewalld
2.查看防火墙状态
# firewall-cmd --state
3.开启、重启、关闭防火墙服务
# 开启
# service firewalld start 或 # systemctl start firewalld.service
# 重启
# service firewalld restart
# 关闭
# service firewalld stop 或 # systemctl stop firewalld.service
# 关闭防火墙开机启动
# systemctl disable firewalld.service
# 开启防火墙开机启动
# systemctl enable firewalld.service
4.查看防火墙规则
# firewall-cmd --list-all
5.查询、开放、关闭端口
# 查询端口是否开放
# firewall-cmd --query-port=8080/tcp
# 开放80端口
# firewall-cmd --permanent --add-port=80/tcp
# 移除端口
# firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙)
# firewall-cmd --reload