启动:
systemctl start firewalld
查状态:
systemctl status firewalld
停止:
systemctl stop firewalld
禁用:
systemctl disable firewalld
在开机时启用一个服务:
systemctl enable firewalld.service
在开机时禁用一个服务:
systemctl disable firewalld.service
查看服务是否开机启动:
systemctl is-enabled firewalld.service
查看已启动的服务列表:
systemctl list-unit-files|grep enabled
查看启动失败的服务列表:
systemctl --failed
firewall-cmd --query-port=80/tcp
开放80端口:
firewall-cmd --permanent --add-port=80/tcp
移除端口:
firewall-cmd --permanent --remove-port=8080/tcp
查看开放了那些端口:
firewall-cmd --list-ports
重启防火墙(修改配置后要重启防火墙):
firewall-cmd --reload