networking:nftables
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| networking:nftables [2023/09/03 08:50] – oscar | networking:nftables [2023/09/03 17:35] (current) – [Links] oscar | ||
|---|---|---|---|
| Line 41: | Line 41: | ||
| Similar to a table, all operational activities can be done on a chain in addition to renaming a chain. Chains should be followed by a name and an open and a close curly bracket. They also come with a type, a hook, a priority, and a policy that must be defined when creating a chain as shown in the next figure. | Similar to a table, all operational activities can be done on a chain in addition to renaming a chain. Chains should be followed by a name and an open and a close curly bracket. They also come with a type, a hook, a priority, and a policy that must be defined when creating a chain as shown in the next figure. | ||
| - | Chain chain-name { type <type> hook <hook> priority | + | <code> |
| + | table [<family>] <name> { | ||
| + | chain < | ||
| + | |||
| + | type < | ||
| + | |||
| + | } } | ||
| + | </ | ||
| ==== Chains Types ==== | ==== Chains Types ==== | ||
| ^Type^Description^ | ^Type^Description^ | ||
| Line 121: | Line 128: | ||
| |return|Return from the current chain and continue at the next rule of the last chain. In a base chain, it is equivalent to accept| | |return|Return from the current chain and continue at the next rule of the last chain. In a base chain, it is equivalent to accept| | ||
| |goto < | |goto < | ||
| + | |||
| + | ===== Query Commands ===== | ||
| + | === Ruleset === | ||
| + | Current ruleset can be printed with: | ||
| + | # nft list ruleset | ||
| + | Remove all ruleset leaving the system with no firewall: | ||
| + | # nft flush ruleset | ||
| + | |||
| + | === Tables === | ||
| + | To list all tables: | ||
| + | # nft list tables | ||
| + | List chains and rules in a table. To list all chains and rules of a specified table: | ||
| + | # nft list table family_type table_name | ||
| + | To delete a table. This will destroy all chains in the table: | ||
| + | # nft delete table family_type table_name | ||
| + | Flush table | ||
| + | To flush/clear all rules from a table: | ||
| + | # nft flush table family_type table_name | ||
| + | List rules | ||
| + | The following lists all rules of a chain: | ||
| + | # nft list chain family_type table_name chain_name | ||
| + | Delete a chain. To delete a chain, the chain must not contain any rules or be a jump target. | ||
| + | : | ||
| + | # nft delete chain family_type table_name chain_name | ||
| + | Flush rules from a chain: | ||
| + | # nft flush chain family_type table_name chain_name | ||
| ===== Links ===== | ===== Links ===== | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
networking/nftables.1693731033.txt.gz · Last modified: by oscar
