暂时只会用得的到这些了,记一个小笔记

启动相关

关闭防火墙

systemctl stop firewalld.service

开启防火墙

systemctl start firewalld.service

关闭开机启动

systemctl disable firewalld.service

开启开机启动

systemctl enable firewalld.service

重新加载

firewall-cmd --reload

查询相关

查询状态

systemctl status firewalld

列出所有服务

systemctl list-unit-files

端口相关

开放端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

关闭端口

firewall-cmd --zone=public --remove-port=80/tcp --permanent