New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
What firewall do you use?
been using ufw for all of my firewall for my servers but iv been thinking of switching to nftables since it looks more advanced and stable
the quiz is upside down
- What type do you use?43 votes
- ufw58.14%
- iptables13.95%
- nftables18.60%
- other  6.98%
- Cloudflare (and CF tunnels)  2.33%


Comments
All of these actually use nftables under the hood. UFW is an iptables frontend and modern iptables is usually iptables-nft, which just translate iptables commands into (sloppy) nftables rules. But writing directly in nftables is always best.
I like to use nftables, but if bpfilter becomes stable and usable one day, I'll switch in a heartbeat because the performance improvement is absolutely unbeatable and its extensibility is limitless.
The nft syntax can be a little confusing at first, but it's really not that bad. A basic "allow all out, allow SSH in from 203.0.113.69 only, allow web traffic in from any IP" ruleset would be:
Btw, you can also use it for more complex things like port knocking (in a bit of a hacky way), DNAT, forcing certain applications to use certain source IPs, and even loopback and output filtering for server hardening:
The only issue I have with nftables is that there's no xtables integration so there's no xt_bpf, which means I can't directly integrate BPF programs with nftables. But that's not an issue for 99.9% of users who don't need to do DPI.
ufw is nice and easy to use for simple firewalls but I think it's best to learn nftables because it gives you total control and access to more features than ufw (which really just wraps nftables). It has a bit of a learning curve but it's really not bad. Once you start needing more complex firewalls ufw won't cut it.
Nftables + RHEL ftw
Thanks man! I need more digging on this.
If you already know iptables, you can use
iptables-translate(8)to convert from iptables to nftables. It's not an optimized translation by any means, but it gives you a good idea about how changes to iptables rules result in changes to the nft rules.Some usage examples are here:
@Fubuki You should have added
pfto the list for the BSD folks, an option for "none" for naïve people, and an option for "my hypervisor's firewall" for people who configure the firewall using their VPS' control panel.And
npfso i can throw up a littleuse XDP, even if its XDP Generic it still greatly offers you higher capabilities than iptables.
Yep, that's uses eBPF like bpfilter. It's amazingly powerful! Each rule is JIT compiled into native machine code.
Back in the day before XDP was stable, I would just use xt_bpf in the raw iptables chain, which gave similar performance (but still not as good).
Kinda depends on who's being addressed i guess. I mean, there's a reason UFW is so far ahead. The average user usually isn't looking for something fancy but just wants to block a bunch of ports. Once something goes beyond that most people check out pretty quickly and even if not the general solutions already do way more stuff than the average person would use. I don't think this can be generalized.
XDP is generally used for earlier filtering, so it actually augments UFW (and iptables and the like) rather than replacing it. It runs extremely early in the network stack which makes it good for DDoS protection so that packets can be discarded or redirected before they hit the much heavier (and more easily overwhelmed) NetFilter code.
Sure, i didn't say it was bad or would necessarily do anything at all but just that it goes beyond what most users care about. People stick to UFW because they don't feel the need to go beyond that. I mean if there was a lot of stuff people were missing, there would be more people looking into at least iptables or nfttables, right?
True, and unless you're handling many millions or billions of PPS, the equivalent ruleset for ufw, iptables, or nftables would be more than enough and XDP would be a premature micro-optimization.
Excactly. I mean, it's a good pointer, no question about that but i just wanted to relativize the imperative form of "use" a little. People getting into writing their own rule sets will regularly already be a little intimidated as is. In this case it's probably not overly helpful to feel pushed into adding yet another layer of specialized tooling making the whole thing become even more abstract than it already is.
We did a benchmark using internal testing VM to VM,
Ryzen 9950x
32GB Ram
MLX5 Interface 2x 100GbE (PCIe Gen 3, so roughly 120Gbps +-)
iptables = 15Mil PPS
xdp native = 94Mil PPS
Currently we are using 9654, 7742, 9960x, PCIE Gen 4 NIC
2x 100GbE CX6
180M PPS Each
With ZERO additive latency (under 1MS so its unreadable for us)
While iptables added soo much latency, roughly 20MS +- (during load)
Thanks for the data. I guess I'll have claude optimized my filter
@AlteredParadox, you still got quota to burn?
What are you currently using? I don't mind giving some assistance and advice!
LLMs are actually pretty bad at optimizing this kind of thing.
never used XDP before, how does it work like port blocking n such like if i were to deploy it on a VPS, how can it detect before the kernel responds?
ill keep a note on that next time