Table Syntax(nftables)

Table Syntax(nftables)

Content #

{add | create} table [family] table [ {comment comment ;} { flags 'flags ; }]
{delete | list | flush} table [family] table
list tables [family]
delete table [family] handle handle

There are four commands available when working with a table:

  1. add - Add a table.
  2. delete - Delete a table.
  3. list - Display all of the chains and rules for a table.
  4. flush - Clear all chains and rules in a table.

list which tables are available:

nft list tables

define a table that will hold normal firewall chains and rules:

nft add table filter

Further information about the table

nft list table filter

When listing rules, adding the -a option to show handle numbers is quite helpful. The handle can be used to modify or delete a rule rather easily.

  • Prevent both address and port resolution

    nft list table filter -nn
    

From #