Nftables: Difference between revisions

From wiki
Jump to navigation Jump to search
Created page with "nftables is the successor of iptables At first glance [https://wiki.debian.org/nftables] it looks a bit like a ufw {| class="wikitable" style="width:35%" |+ Address families ! Family ! Remark |- | ip | IPv4 This is the default if no family is specified |- | ip6 | IPv6 |- | inet | IPv4 + IPv6 |- | arp | arp |- | bridge | bridge |} =Install and activate= Debian comes with nftables installed since Buster. ;apt install nftables :Install if needed ;sys..."
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
nftables is the successor of [[iptables]]
[[category:networking]]
[[category:Linux/Unix]]
nftables is the successor of [[iptables]] for managing firewall rules.


At first glance [https://wiki.debian.org/nftables] it looks a bit like a [[iptables#ufw|ufw]]
At first glance [https://wiki.debian.org/nftables] it looks a bit like a [[iptables#ufw|ufw]]
Line 31: Line 33:
:Create the service
:Create the service
;systemctl start nftables
;systemctl start nftables
:service nftables start
;service nftables start
:Start the service
:Start the service
;systemctl status nftables
;systemctl status nftables
;service start nftables
;service nftables status
:Show status


=Confiuration=
=Confiuration=
Line 40: Line 43:


=Commands=
=Commands=
;nft list ruleset
:Show the current ruleset in the format you can load with nft -f (see below)
;nft list table <family> filter
;nft list table <family> filter
:Show the current filters for <family>.
:Show the current filters for <family>.
;nft -f <filename>
:Load rules from <filename>

Latest revision as of 20:24, 18 January 2026

nftables is the successor of iptables for managing firewall rules.

At first glance [1] it looks a bit like a ufw

Address families
Family Remark
ip IPv4 This is the default if no family is specified
ip6 IPv6
inet IPv4 + IPv6
arp arp
bridge bridge

Install and activate

Debian comes with nftables installed since Buster.

apt install nftables
Install if needed
systemctl enable nftables.service
Create the service
systemctl start nftables
service nftables start
Start the service
systemctl status nftables
service nftables status
Show status

Confiuration

The configuration is in /etc/nftables.conf

Commands

nft list ruleset
Show the current ruleset in the format you can load with nft -f (see below)
nft list table <family> filter
Show the current filters for <family>.
nft -f <filename>
Load rules from <filename>