Debian 11防火墙或者包过滤



Debian 11 默认使用 nftables 作为 netfilter 前端,使用 nft 命令进行管理,但是默认并没有启用。
Linux 内核嵌入了 netfilter 防火墙,可以从用户空间使用 iptables、ip6tables、arptables 和
ebtables 命令对其进行控制。
然而,Netfilter iptables 命令正在被 nftables 取代,这避免了它的许多问题。 它的设计涉及较少的代
码重复,并且只需使用 nft 命令即可对其进行管理。
Debian Buster(即 Debian 10,包括 11)默认使用 nftables 框架。
要在 Debian 中启用默认防火墙,请执行:
# apt install -y nftables
Reading package lists... Done
...
# systemctl enable nftables.service
Created symlink /etc/systemd/system/sysinit.target.wants/nftables.service →
/lib/systemd/system/nftables.service.
关于 nft 命令的语法和用例,参看其他文章。