
Yes, that’s what everyone says:rab0171610 wrote:[...] That being said, I did read that UFW has support for using either IP Tables or Nftables as the backend. [...]
I dont know also ... maybe you must de-install iptables and emerge nftables ... butrab0171610 wrote:[...] I am not sure what I will need to do other than install nftables to make the migration. [...]
... you have iptables because iproute2 (installed by @system in stage3) has enabled the Use-flag "iptables" by default (*). So, maybe you must re-emerge iproute2 without this Use-flag and can then de-install iptables ... but ...rab0171610 wrote:[...] I do not recall ever having to set up Iptables, it is simply installed on my system. [...]
Code: Select all
# emerge -cpv iptables
Calculating dependencies... done!
net-firewall/iptables-1.8.11-r1 pulled in by:
sys-apps/iproute2-6.18.0 requires >=net-firewall/iptables-1.4.20:=, >=net-firewall/iptables-1.4.20:0/1.8.3=
>>> No packages selected for removal by depclean
[...]
# emerge -cpv iproute2
Calculating dependencies... done!
sys-apps/iproute2-6.18.0 pulled in by:
@system requires sys-apps/iproute2
Yes, iptables (and IPv4 support) will probably be phased out at some point ... but my personal assessment is that this won’t happen for another 10 or 15 years. So, my opinion is: Never change a working solutionrab0171610 wrote:[...] I didn't even know that Iptables was being phased out and nftables was being phased in until this happened.
Should I leave things as they are for now or should I feel a sense of urgency to migrate to nftables?
What is your opinion?

Code: Select all
Make ufw depends on nftables instead iptables
Bug #2114851 reported by Marcos Alano on 2025-06-17Code: Select all
iptables is a program used to configure and manage the kernel's netfilter modules. It should be replaced with its successor nftables. Code: Select all
nftables is the successor to iptables. It replaces the existing iptables, ip6tables, arptables, and ebtables framework. It uses the Linux kernel and a new userspace utility called nft. nftables provides a compatibility layer for the iptables/ip6tables and framework. 

From a quick look at UFW's syntax, it seems broadly similar to the syntax of OpenBSD's PF, which i certainly find more pleasant than iptables' syntax (and perhaps nftables' syntax, although i haven't spent much time with it yet).rab0171610 wrote:I think what I like about UFW is that the syntax is very much reminiscent of setting up Cisco equipment, using human readable statements in a deliberate sequence to set up the firewall.

Code: Select all
To Action From
-- ------ ----
Anywhere on tun0 ALLOW Anywhere
192.168.0.0/24 ALLOW Anywhere
Anywhere ALLOW 192.168.0.0/24
Anywhere ALLOW OUT Anywhere on tun0
192.168.0.0/24 ALLOW OUT Anywhere
53/udp ALLOW OUT Anywhere
53/tcp ALLOW OUT Anywhere
xxx.xxx.xx.xxx 1194/udp ALLOW OUT Anywhere 
Thank you for pointing that out, my eyes glazed over and my head was spinning by the time I scrolled that far down the Gentoo nftables wiki page.wjb wrote:There are links to the nftables wiki at the end of the Gentoo wiki page, which I personally found much more readable. A useful section is "Moving from iptables to nftables", which was enough to get my iptables rules converted to nftables. From there, with a concrete representation of what I wanted, it was possible to figure out what was going on.
I am confused ... why do you need an ALLOW OUT when you have already an ALLOW (all) ?rab0171610 wrote:[...]The default UFW policy is to deny.
This is my current UFW rule set. It allows traffic to and from on tun0 (VPN tunnel), allows local network traffic in and out, DNS OUT, and OUT to the VPN server's IP.Code: Select all
To Action From -- ------ ---- [...] 192.168.0.0/24 ALLOW Anywhere Anywhere ALLOW 192.168.0.0/24 [...] 192.168.0.0/24 ALLOW OUT Anywhere [...]
Code: Select all
# iptables -L -vnAnother way to get all iptables rules is "iptables-save". If you give me both outputs of your iptables, I could write it for nftables ... and ... maybe ... make it a little bit more secure ...rab0171610 wrote:[...] I can't imagine every having enough understanding of nftables to have the skills needed to directly configure it to do the equivalent of the above UFW rule set.
Let me quote from my article:rab0171610 wrote:Thank you for pointing that out, my eyes glazed over and my head was spinning by the time I scrolled that far down the Gentoo nftables wiki page.wjb wrote:There are links to the nftables wiki at the end of the Gentoo wiki page, which I personally found much more readable. A useful section is "Moving from iptables to nftables", which was enough to get my iptables rules converted to nftables. From there, with a concrete representation of what I wanted, it was possible to figure out what was going on.
I will look at those links again, especially https://wiki.nftables.org/wiki-nftables ... o_nftables .
The most important link at all:
https://wiki.nftables.org/wiki-nftables ... /Main_Page
Most important command: nft list ruleset
If you install the iptables package with the Use-flag "nftables", you get a great program: iptables-translate ... guess what it does

You are right, I do not. I once was troubleshooting a local kde-filesharing/avahi/network discovery issue and forgot to delete a temporary rule.pietinger wrote: I am confused ... why do you need an ALLOW OUT when you have already an ALLOW (all) ?