Skip to content

Firewalld 防火墙

防火墙命令

用途命令
启动一个服务systemctl start firewalld
关闭一个服务systemctl stop firewalld
重启一个服务systemctl restart firewalld
显示一个服务的状态systemctl status firewalld
在开机时启用一个服务systemctl enable firewalld
在开机时禁用一个服务systemctl disable firewalld
查看服务是否开机启动systemctl is-enabled firewalld
查看已启动的服务列表systemctl list-unit-files
查看启动失败的服务列表systemctl --failed
查看版本firewall-cmd --version
查看帮助firewall-cmd --help
显示状态firewall-cmd --state
查看所有打开的端口firewall-cmd --zone=public --list-ports
更新防火墙规则firewall-cmd --reload
查看区域信息firewall-cmd --get-active-zones
查看指定接口所属区域firewall-cmd --get-zone-of-interface=eth0
拒绝所有包firewall-cmd --panic-on
取消拒绝状态firewall-cmd --panic-off
查看是否拒绝firewall-cmd --query-panic

Released under the MIT License.