Skip to Content
Mastering Linux Security and Hardening
book

Mastering Linux Security and Hardening

by Donald A. Tevault
January 2018
Intermediate to advanced
376 pages
8h 45m
English
Packt Publishing
Content preview from Mastering Linux Security and Hardening

Using nft commands

There are two ways to use the nft utility. You can just do everything directly from the Bash shell, prefacing every action you want to perform with nft, followed by the nft subcommands. You can also use nft in interactive mode. For our present purposes, we'll just go with the Bash shell.

Let's first delete our previous configuration, and create an inet table, since we want something that works for both IPv4 and IPv6. We'll want to give it a somewhat descriptive name, so let's call it ubuntu_filter:

sudo nft delete table inet filtersudo nft list tablessudo nft add table inet ubuntu_filtersudo nft list tables

Next, we'll add an input filter chain to the table that we just created. (Note that since we're doing this from the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Security and Hardening, The Practical Security Guide

Linux Security and Hardening, The Practical Security Guide

Jason Cannon
Mastering Linux Administration

Mastering Linux Administration

Alexandru Calcatinge, Julian Balog

Publisher Resources

ISBN: 9781788620307Other