Repository navigation
Description
Summary
We should move off of invoking iptables in our containerd runtime and use nftables (netfilter) instead. iptables has been labelled as legacy for MANY years now and are not enabled on newer kernels. Also seeing errors like this more often in our containerd integration tests:
starting task: network add: cni net setup:
plugin type="bridge" failed (add):
failed to list chains: running [/usr/bin/ip6tables -t nat -S --wait]:
exit status 3: ip6tables v1.8.11 (legacy):
can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
Will probably change behaviour to detect if nftables is present and prefer using it over iptables, with iptables being present as a fallback.
Context
Past issues:
- containerd: investigate use of firewalld rather than iptables #5136
- Concourse uses legacy iptables while there are nf_tables on the system #4557
Docs for research:
https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables
https://github.com/google/nftables
Initial motivation for this was seeing the containerd-integration tests failing because some of the iptable modules weren't loaded. For some reason that's not the case anymore, so I'm putting this issue into the backlog.
I think we are blocked on doing this until the CNI firewall plugin has nftables support. Right now we do rely on using the iptables backend with the firewall plugin. All the things we do rely on us hooking into the iptablesAdminChainName. If we aren't in sync with the firewall plugin, then our networking stuff will break.
Other interesting doc:
https://github.com/kubernetes-sigs/knftables/blob/v0.0.19/docs/iptables-porting.md
The other tools in https://github.com/containe…
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]Migrate to nftables[/-][+]Migrate to netfilter (nftables)[/+]taylorsilva commentedon Feb 2, 2026
Reviewing old issues, it looks like we thought about using the CNI plugin for firewalld. firewalld is present on most major linux distributions now. https://firewalld.org/ lists:
There are some big ones missing from this list, like Ubuntu and Debian. Ubuntu uses ufw and Debian appears to not come with anything on top of netfilter. You can install firewalld easily on all major distributions. Vito noticed the same thing #5136 (comment) and he referenced the nftables go pkg from Google too. Funny, looks like the landscape hasn't changed that much.
I think I prefer directly building on nftables instead of on firewalld right now. Doesn't add a pre-req when setting up a Worker. Going to start proceeding in that direction using the Go package from Google: https://github.com/google/nftables
taylorsilva commentedon Feb 2, 2026
Looking at
concourse/worker/runtime/iptables/iptables.go
Line 24 in 1dfdf12
I realized we can specify the iptables binary to use. I tried swapping in
iptables-nftto see if things would just work. Sadly something behaviourally breaks and theworker/runtime/integrationtests fail. Going to keep looking into this path as it would be the least amount of work if I can get it working.taylorsilva commentedon Feb 2, 2026
Ah, well looking at open issues seems to have answered this for me: coreos/go-iptables#101
Looks like this lib doesn't work with
iptables-nftright now! Last update was also 2 years ago so this repo is looking majorly abandoned! Last commit is from a user that no longer works at coreos.Leaving this path and going back to working with Google's nftables package.
taylorsilva commentedon Feb 3, 2026
Might be blocked on making this happen. Right now we do use the CNI firewall plugin:
concourse/worker/runtime/cni_network.go
Lines 96 to 101 in 1dfdf12
Docs for that are here: https://www.cni.dev/plugins/current/meta/firewall/
and they state:
We don't specify which backend to use. Right now on the workers I have access to, most of them don't have firewalld installed so it falls back to using iptables. Regardless, we should be in-sync with whatever the plugin decides to do, using either iptables or nftables. Using both is possible but not recommended:
Source: https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_iptables_to_nftables
It seems like we'd be fighting the firewall plugin potentially and this might already be the case.
Funny, there was a PR to add support: containernetworking/plugins#462
But the author closed the PR and has an unmaintained fork here: https://github.com/greenpau/cni-plugins/tree/main
I reviewed our usage of iptables and it's actually quite limited. We basically use it to do some network setup. It was most recently modified to add the
hermeticvalue to tasks, which drops all network traffic in and out of the container. All usage is in this file: https://github.com/concourse/concourse/blob/1dfdf121f7245360722f693ccd46d5bd15e6ece5/worker/runtime/cni_network.goNot sure which direction to go here. Would be nice if the firewall CNI plugin used nftables but they don't. Someone needs to PR it.
taylorsilva commentedon Feb 4, 2026
Initial motivation for this was seeing the containerd-integration tests failing because some of the iptable modules weren't loaded. For some reason that's not the case anymore, so I'm putting this issue into the backlog.
I think we are blocked on doing this until the CNI firewall plugin has nftables support. Right now we do rely on using the
iptablesbackend with the firewall plugin. All the things we do rely on us hooking into theiptablesAdminChainName. If we aren't in sync with the firewall plugin, then our networking stuff will break.Other interesting doc:
https://github.com/kubernetes-sigs/knftables/blob/v0.0.19/docs/iptables-porting.md
The other tools in https://github.com/containernetworking/plugins/ use https://github.com/kubernetes-sigs/knftables (
sigs.k8s.io/knftables) for nftables. That lib uses thenftcli.justinkoreska commentedon Feb 13, 2026
FYI we are trying to deploy Concourse via Helm on a Talos Kubernetes cluster and the worker pods fail with a similar error:
I assume this is because Talos now uses
nftablesand does not supportiptables.taylorsilva commentedon Feb 13, 2026
Yup, that would be why. As I mentioned though, we're blocked on the firewall CNI plugin not supporting nftables.
Tyraeis commentedon May 16, 2026
I ran into the same issue as @justinkoreska trying to run worker pods on Talos and figured I'd see if I could hack together a solution. I ended up getting the workers to run by creating a custom version of the
concourse/concoursedocker container that replacesiptables/ip6tableswithiptables-nft+iptables-wrappers:(I also had to set the sysctl
user.max_user_namespacesto a nonzero value, but that's unrelated)I haven't done very thorough testing with the setup, but I was able to successfully run a pipeline so it at least seems to be able to run containers.
Rereading this thread, I noticed that @taylorsilva already tried
iptables-nft:I tried running the worker/runtime/integration tests myself on my Arch Linux desktop to see if I also saw failures (using the
iptablespackage, which is actuallyiptables-nftunder the hood). I got an error with theMASQUERADEflag at first, but runningsudo modprobe nft_masqon the host machine fixed it. After that change, the tests passed:For reference, this is what I get if I use the legacy iptables backend:
Not sure if there's something different with my setup or if I'm missing something, but this suggests it might be possible to migrate via
iptables-nftwithout having to wait for the firewall CNI plugin?taylorsilva commentedon May 20, 2026
Thanks for the sharing your research. I'll take a look into this again. Wish I had recorded the errors I ran into when I initially tried using
iptables-nft.vfx1b commentedon May 29, 2026
Seeing this error with a concourse cluster deployed to EKS. Worked around it by running
modprobe ip_tableson the affected "newer" node.rfpludwick commentedon Aug 5, 2026
Running on Raspbian/Debian Trixie now, and I've started to see the
iptableserrors. Triedmodprobe ip_tableswith no luck. I tried downgrading to legacy and kube-flannel & kube-proxy fail with nftables errors. I'm stuck mid-upgrade on my nodes between Bookworm & Trixie now, because if I migrate the remaining nodes Concourse will be entirely unable to operate.rfpludwick commentedon Aug 5, 2026
I used @Tyraeis' Dockerfile hack to success (I believe). Made my own to extend it:
Pushed it to https://hub.docker.com/repository/docker/rfpludwick/concourse-nftables-temp/tags/8.2.4/ to use. So far so good.
mubashir1osmani commentedon Oct 3, 2026
i'd like to take this up, firewall CNI plugin hasnt been under development and the last commit was 6 months ago so im not willing to take that route. i can probably find a workaround and migrate to nft, making iptables a legacy fallback
use the nft iptables backend in the image