1.启动防火墙
systemctl start firewalld
如果提示:Failed to start firewalld.service: Unit is masked. 运行下面命令移除
systemctl unmask firewalld
查看防火墙状态
systemctl status firewalld
![](https://i-blog.csdnimg.cn/blog_migrate/d1733477643bf4a7af49c20ec95c6863.png)
3.重启防火墙
firewall-cmd --reload
4.添加服务
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https