//查看防火墙状态
firewall-cmd --state
//启动防火墙
systemctl start firewalld.service
//设置防火墙开机自启
systemctl enable firewalld.service
//重启防火墙
systemctl restart firewalld.service
//开80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
//查看已经开放的端口
firewall-cmd --list-ports
//关闭80端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent
开完端口要重启防火墙才会生效
05-05
2615
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-09
3113
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-10
7071
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-06
4081
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
04-12
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交