Network

nftables

Modern framework for packet filtering and classification replacing iptables.

Synopsis

syntax
nft [OPTION]... [COMMAND]

Examples

Show all firewall rules
sudo nft list ruleset
Create a filter table
sudo nft add table inet filter
Allow HTTP traffic
sudo nft add rule inet filter input tcp dport 80 accept
Clear all rules
sudo nft flush ruleset

Common options

FlagDescription
list rulesetShow all rules
add ruleAdd a new rule
delete ruleRemove a rule
flush rulesetRemove all rules
-fRead commands from file

About nftables

The `nftables` command modern framework for packet filtering and classification replacing iptables. Networking commands handle connectivity testing, DNS resolution, data transfer, remote access, firewall rules, and traffic analysis.

Linux is the dominant server operating system, and strong networking skills are essential for web hosting, container orchestration, security auditing, and infrastructure management. The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man nftables`).

The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Network Commands

Other commands in the Network category

Related tools