firewalld 常用命令


1
2
3
4
5
6
7
8
9
10
# 是否运行:
firewall-cmd —state
# 查看端口规则(参数--permanent 是永久配置,重启依然有效):
firewall-cmd —permanent —list-ports
# 删除端口规则:
firewall-cmd —permanent —remove-port=[PORT/(tcp/udp)]
# 添加端口规则:
firewall-cmd —permanent —zone=public —add-port=[PORT/(tcp/udp)]
# 重载规则:
firewall-cmd --reload

Zone:

1
/etc/firewalld/zones/*.xml