You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[we have copies of this bug scattered about as comments on other bugs, so creating one tracking bug]
On Linux, when Tailscale is running in a container, we should ask the kernel directly whether iptables-legacy or iptables-nft is the right interface and use the right binary, regardless of what the "iptables" binary is a symlink to on disk.
And if the right binary is not available, fail loudly.
That is, the host environment outside of the container could be using iptables-legacy vs iptables-nft and even if the host's Debian alternatives or equivalent is correct, the container's alternatives might be wrong.
This manifests in lots of weird iptables errors.
@andrew-d has done all the hard work for this bug already. Filing this bug to cross-reference other bugs against.
Reacted by Kun Lai, Kevin Abiera, Marcus Pettersen Irgens, Josh Enders, Malte Poll, Chris Wiggins, Fredrik Sundqvist, Rasmus Hansen, Chris, ignoramous and 3 more
on coreos for example just detecting that could be tricky as both variants exist... checking for existing rules on one of them would also be quite a hack...
i would still prefer a way to have some toggle to force the container
if nftables are installed and iptables-nft is as well available to stay compatible like on the current fedora coreos builds it does not work and need to be forced to use nftables
Activity
zyclonite commentedon Jan 15, 2023
DentonGentry commentedon Jan 15, 2023
zyclonite commentedon Jan 16, 2023
on coreos for example just detecting that could be tricky as both variants exist... checking for existing rules on one of them would also be quite a hack...
i would still prefer a way to have some toggle to force the container
rodrigc commentedon May 31, 2023
Maybe replicating the logic done in Kubernetes to detect iptables vs. nftables is an option:
https://unix.stackexchange.com/a/589006
DentonGentry commentedon May 31, 2023
#391 is also relevant, if
tailscaledcan stop usingiptables/nftablesbinaries altogether.rodrigc commentedon May 31, 2023
@DentonGentry I am at Tailscale Up today,
and talked with a manager, @catzkorn . @catzkorn mentioned that there is someone at tailscale ( @KevinLiang10 ) who is scoping out a solution to address #391 .
That solution for that will probably solve #5621
rodrigc commentedon Sep 5, 2023
I verified here that the logic in #391 to detect nftables works inside a container
zyclonite commentedon Sep 6, 2023
if nftables are installed and iptables-nft is as well available to stay compatible like on the current fedora coreos builds it does not work and need to be forced to use nftables
rodrigc commentedon Sep 6, 2023
@zyclonite in your environment did you have to set
TS_DEBUG_FIREWALL_MODE=nftablesas specified here: https://tailscale.com/kb/1294/firewall-mode/#how-to-set-the-firewall-mode ?zyclonite commentedon Sep 6, 2023
yes
rodrigc commentedon Sep 6, 2023
@zyclonite if you set
TS_DEBUG_FIREWALL_MODE=nftables, what do lines appear in the tailscaled logs when detecting the type of firewall?24 remaining items
util/linuxfw: add additional nftable detection logic
util/linuxfw: fix support for containers without IPv6 iptables filters
util/linuxfw: fix support for containers without IPv6 iptables filters (
N (#4)
util/linuxfw: fix support for containers without IPv6 iptables filters (
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fallback to nftables when iptables not found
util/linuxfw: fall back to nftables when iptables not found
util/linuxfw: fall back to nftables when iptables not found
foertel commentedon Apr 26, 2026
Did we just abandon this? 🤓
On current CoreOS still weird iptables errors pop up in
tailscale statuswhen running currenttailscale/tailscaledocker container.It is fine when I set
-e TS_DEBUG_FIREWALL_MODE=nftables.