Linux Commands Helper

💬 Your AI-powered Linux assistant

nft Command - Manage Netfilter Firewall Rules

The nft command is used to set up, maintain, and inspect packet filtering and classification rules in the Linux kernel. It is the modern replacement for iptables.

Syntax

nft [options] [commands]

Examples

nft list ruleset

Display the current firewall ruleset.

nft add table inet filter

Create a new table called 'filter' in the 'inet' family.

nft add chain inet filter input { type filter hook input priority 0 ; }

Add a new chain to the 'filter' table for input packets.

Notes

  • nft is intended to replace the older iptables, ip6tables, arptables, and ebtables tools.
  • Requires root privileges to modify firewall rules.
  • Configuration can be saved and restored using nft list ruleset > rules.nft and nft -f rules.nft.

© 2025 Linux Commands Helper. All rights reserved.

This project is under construction. Feedback and contributions are welcome.

Fazier badgeFeatured on Startup Fame