![centos7防火墙端口设置常用命令](https://www.haibianshibei.com/wp-content/uploads/2024/06/screenshot-1717833120946.png)
#查看防火墙状态
systemctl status firewalld
#开启防火墙
systemctl start firewalld
#关闭防火墙
systemctl stop firewalld
#查看当前firewall状态
firewall-cmd --state
#重启firewall
firewall-cmd --reload
#查看已经开放的端口:
firewall-cmd --list-ports
#开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
#开启端口后需要重启防火墙
命令含义:
--zone #作用域
--...