Forrest logo
back to the nft tool

nft:tldr:fb70a

nft: Add a new table with family "inet" and table "filter".
$ sudo nft add table ${inet} ${filter}
try on your machine

This command is using the nft command-line utility with superuser privileges (sudo). It adds a new table to the current nftables configuration.

Here's a breakdown of each element:

  • sudo: This is a command in Linux and Unix-like operating systems that allows a user with appropriate permissions to execute a command as the superuser or another user. In this case, it's used to run the nft command with root privileges, which is required for modifying the nftables configuration.

  • nft: This is the command-line utility for managing the nftables framework, which is a firewall solution in Linux. nft is used to interact with the nftables kernel subsystem and make changes to the firewall rules and policies.

  • add table: This part of the command is used to add a new table to the nftables configuration. A table is a high-level container that holds chains, which, in turn, contain rules. It allows organizing and managing different sets of rules in a structured manner.

  • ${inet}: This is an example of a variable. It represents the address family or network protocol. In this case, ${inet} is a parameter to specify the table's address family as inet, which stands for IPv4.

  • ${filter}: Similarly, ${filter} is another variable representing the table's name. In this case, it specifies the table's name as filter. The filter table is commonly used for filtering incoming and outgoing network traffic.

Overall, the command sudo nft add table ${inet} ${filter} is used to add a new table with the specified address family and name to the nftables configuration, allowing further customization and configuration of firewall rules for filtering network traffic.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nft tool