nftables ist der moderne Nachfolger von iptables und bietet eine einheitliche Syntax für Paketfilterung und NAT.
sudo nft list ruleset sudo nft add rule inet filter input tcp dport 22 accept sudo nft delete rule inet filter input handle <handle>
# Beispiel-Regeln in /etc/nftables.conf eintragen:
table inet filter {
chain input {
type filter hook input priority 0;
tcp dport {21,22,80} accept
}
}
# Regeln laden und beim Booten aktivieren:
sudo nft -f /etc/nftables.conf
sudo systemctl enable nftables