# 查看防火墙状态(适用于使用 firewalld 的系统)
sudo firewall-cmd --state
# 列出所有防火墙规则(适用于使用 firewalld 的系统)
sudo firewall-cmd --list-all
# 查看 iptables 规则(适用于使用 iptables 的系统)
sudo iptables -L -v -n
# 查看 ip6tables 规则(适用于使用 ip6tables 的系统)
sudo ip6tables -L -v -n
# 查看 nftables 规则(适用于使用 nftables 的系统)
sudo nft list ruleset
firewalld 是现代 Linux 系统中常用的防火墙管理工具,firewall-cmd
是其命令行工具。
--state
用于查看防火墙是否正在运行。--list-all
用于列出当前活动的区域和相关规则。iptables 是较老的防火墙工具,仍然被广泛使用。
-L
用于列出规则。-v
提供详细输出。-n
以数字形式显示 IP 地址和端口。ip6tables 是用于管理 IPv6 流量的防火墙工具,用法与 iptables 类似。
nftables 是较新的防火墙工具,逐渐替代 iptables 和 ip6tables。
nft list ruleset
用于列出所有 nftables 规则。上一篇:linux查看目录有多少文件
下一篇:linux新建一个文件
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站