查看防火墙状态
systemctl status firewalld
启动防火墙
systemctl start firewalld
关闭防火墙
systemctl stop firewalld.service
防火墙开机自启
systemctl enable firewalld.service
允许HTTP
firewall-cmd --permanent --zone=public --add-service=http
允许HTTPS
firewall-cmd --permanent --zone=public --add-service=https
开放端口
firewall-cmd --permanent --zone=public --add-port=[your port]/tcp
重启防火墙
firewall-cmd --reload
检测端口是否被占用
netstat -tunlp |grep [port]
评论区