Используется по умолчанию в Debian 10 для управления встроенным в ядро Netfilter.
apt-get install nftables
systemctl enable nftables
systemctl start nftables
systemctl status nftables
cat /etc/nftables.conf
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
# Localhost traffic
iifname lo accept
# Drop invalid connections
ct state invalid drop
# Established traffic
ct state established accept
# HTTP and HTTPS traffic
tcp dport { http, https } accept
}
chain forward {
type filter hook forward priority 0; policy drop;
}
chain output {
type filter hook output priority 0; # Default policy is accept
}
}
Загрузка правил из конфигурационного файла
nft -f /etc/nftables.conf
или, если файл исполняемый, как в примере выше
/etc/nftables.conf
Просмотр правил, загруженных в ядро
nft list ruleset