Configuring nftables on Ubuntu 18.04

On the Ubuntu 18.04 virtual machines that we'll be using, the default nftables.conf file is nothing more than a meaningless placeholder. The file you need, which you'll copy over to replace the default nftables.conf file, is elsewhere. Let's check it out. 

First, we'll go into the directory where the sample configurations are stored and list the sample configuration files:

cd /usr/share/doc/nftables/examples/syntaxls -l

You should see something similar to the following:

donnie@munin:/usr/share/doc/nftables/examples/syntax$ ls -l total 60 -rw-r--r-- 1 root root 150 Feb 2 2018 arp-filter -rw-r--r-- 1 root root 218 Feb 2 2018 bridge-filter -rw-r--r-- 1 root root 208 Feb 2 2018 inet-filter. . .. . . -rw-r--r-- ...

Get Mastering Linux Security and Hardening - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.