firewall-cmd --list-all
可以用于列出系统中所有防火墙规则的详细信息,包括已激活的防火墙区域、服务和端口等。
这些信息能够帮助您了解系统中当前已配置的防火墙规则,以及允许或禁止访问的服务和端口等相关信息。
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh cockpit
ports:
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
这个命令用于查看防火墙的当前配置,下面是命令输出的详细解释:
public (active)
: 表示公共区域的防火墙配置处于活动状态。target: default
: 确定了默认的防火墙目标。icmp-block-inversion: no
: 表示没有启用 ICMP 阻塞的反转。interfaces: eth0
: 列出了防火墙正在监控和保护的网络接口。sources:
: 这里列出了允许通过防火墙的流量来源。services: dhcpv6-client ssh cockpit
: 列出了已经在防火墙中允许通过的服务,包括 DHCPv6 客户端、SSH 和 Cockpit。ports:
: 如果有特定的端口允许通过防火墙,将会在这里列出。protocols:
: 列出了防火墙允许通过的特定协议。forward: no
: 表示未启用转发。masquerade: no
: 表示未启用伪装。forward-ports:
: 这里列出了已经配置的端口转发规则。source-ports:
: 列出了允许通过的源端口。icmp-blocks:
: 如果有出被阻止的 ICMP 类型,将会在这里显示。rich rules:
: 这里可以包含更为复杂和精细的防火墙规则设置。