系统操作防火墙
systemctl start firewalld # 开启
systemctl restart firewalld # 重启
systemctl status firewalld # 或者
systemctl disable firewalld # 禁用
systemctl stop firewalld # 关闭
防火墙命令
firewall-cmd –version # 防火墙版本
firewall-cmd –state # 防火墙状态
firewall-cmd –zone=public –list-ports # 查看所有打开的端口
firewall-cmd –zone=public –query-port=80/tcp # 查看80端口是否打开
firewall-cmd –zone=public –add-port=80/tcp –permanent # 添加80端口 (–permanent永久生效,没有此参数重启后失效)
firewall-cmd –reload # 重载
firewall-cmd –zone=public –remove-port=80/tcp –permanent # 删除端口