Configuring tables: Difference between revisions

From nftables wiki
Jump to navigation Jump to search
(Created page with "You can also delete tables with the following command: <source lang="bash"> % nft delete table ip foo </source> '''Troubleshooting''': Since Linux kernel 3.18, you can delet...")
 
m (Added 'Adding tables' section)
Line 1: Line 1:
= Adding tables =
<source lang="bash">
% nft add table ip filter
</source>
You can also delete tables with the following command:
You can also delete tables with the following command:
= Deleting tables =


<source lang="bash">
<source lang="bash">

Revision as of 03:22, 1 March 2017

Adding tables

% nft add table ip filter

You can also delete tables with the following command:

Deleting tables

% nft delete table ip foo

Troubleshooting: Since Linux kernel 3.18, you can delete tables and its content with this command. However, before that version, you need to delete its content first, otherwise you hit an error that look like this:

% nft delete table filter
<cmdline>:1:1-19: Error: Could not delete table: Device or resource busy
delete table filter
^^^^^^^^^^^^^^^^^^^

Flushing tables

You can delete all the rules that belong to this table with the following command:

% nft flush table ip filter

This removes the rules for every chain that you register in that table.