Nftables usage

From wikinotes

Info

You can create tables/chains/rules on the commandline, but it's way more readable to write a file.
You can even split your rules withing multiple files and source them.

nft list tables                   # list tables
nft list table 'inet' 'my_table'  # list chains in 'inet' table 'my_table'

nft list ruleset                  # list all rules

nft describe <expression>         # get info about reqd types

Validating Rules

sudo nft -c -f /etc/nftables.conf

Clearing Rules

Clear all Rules.
Add this to the top of your nftables file to flush rules every time your file is loaded.

nft flush ruleset
nft flush table 'table_name'
nft delete table 'table_name'