Content #
{add | create} chain [family] table chain [{
type type hook hook [device device] priority priority ;
[policy policy ;]
[comment comment ;]
}]
{delete | list | flush} chain [family] table chain
list chains [family]
delete chain [family] table handle handle
rename chain [family] table chain newname
When operating on a chain, there are six commands available:
- add - Add a chain to a table.
- create - Create a chain within a table unless a chain with the same name already
exists.
- delete - Delete a chain.
- flush - Clear all rules in a chain.
- list - Display all rules in a chain.
- rename - Change the name of a chain.
Three basic chain type #
- filter - Used for packet filtering
- route - Used for packet routing
- nat - Used for Network Address Translation
Examples #
-
Add an input chain to the filter table
nft add chain filter input { type filter hook input priority 0 \; }