Getting started with nftables

Let's start with a clean snapshot of our Ubuntu virtual machine, and install the nftables package. 

The command-line utility for nftables is nft. You can either do nft commands from the Bash shell, or you can do sudo nft -i to run nft in interactive mode. For our present demos, we'll just run the commands from the Bash shell.

Now, let's take a look at the list of installed tables:

sudo apt install nftablessudo nft list tables

Hmmm... You didn't see any tables, did you? So, let's load some up.

If you look at the nftables.conf file in the /etc directory, you'll see the beginnings of a basic nft firewall configuration:

#!/usr/sbin/nft -fflush rulesettable inet filter {        chain input { type filter hook input priority ...

Get Mastering Linux Security and Hardening now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.