moby: Docker 28 stops containers communicating with tailscale network.
Description
I use tail scale to allow containers/services to communicate with containers on different hosts. Prior to 28, no changes where needed as docker would use /etc/resolv.conf which tailscale updates to point to itself as a resolver,
Running docker run --rm alpine cat /etc/resolv.conf on 27.5.1 shows
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.
nameserver 100.100.100.100
search tail67b84.ts.net
# Based on host file: '/etc/resolv.conf'
Reading the change logs for 28, my understanding this should still happen?
Reproduce
Update to docker engine 28 Containers talking to Tailscale computers will no longer work.
Expected behavior
They continue to talk
docker version
Client: Docker Engine - Community
Version: 27.5.1
API version: 1.47
Go version: go1.22.11
Git commit: 9f9e405
Built: Wed Jan 22 13:41:17 2025
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.5.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.11
Git commit: 4c9b3b0
Built: Wed Jan 22 13:41:17 2025
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.25
GitCommit: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc:
Version: 1.2.4
GitCommit: v1.2.4-0-g6c52b3f
docker-init:
Version: 0.19.0
GitCommit: de40ad0
docker info
Client: Docker Engine - Community
Version: 27.5.1
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.21.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.33.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 11
Running: 10
Paused: 0
Stopped: 1
Images: 11
Server Version: 27.5.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
runc version: v1.2.4-0-g6c52b3f
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.0-31-cloud-amd64
Operating System: Debian GNU/Linux 12 (bookworm)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.886GiB
Name: SYD01
ID: 5420cb38-1a11-4c16-a531-d77bc7577948
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Default Address Pools:
Base: 172.16.0.0/12, Size: 24
Additional Info
I have rolled back to 27.5.1 which restores communication.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 55 (24 by maintainers)
Thanks again to everyone who’s reported issues and provided debug info here … we’re about to start packaging a 28.0.1 release.
I believe all the issues here will be addressed by some combination of:
The possible exception is the issue with swag (@digdilem), which we’ve not been able to repro - but it’s still likely to be covered. If not, we’ll take another look.
I’ll close this issue as completed, but will still see further comments/questions if any. Hopefully this isn’t going to be necessary but, if there are still problems with 28.0.1, it’d be best to raise new issues.
I’ve had this issue after upgrade too, have tried setting
tailscale set --stateful-filtering=falsebut no dice, is there anything I can do to fix this?EDIT:
Running these commands fixed it:
The issue was related to Oracle Cloud rules.
Thanks @pschneid - that sounds likely. If
sysctl net.ipv4.ip_forwardis enabled on the host (as it is by Docker and, quite likely, Plesk), the default policy for the FORWARD chain should be set to DROP to keep containers/VMs etc running on the host isolated.If that rule is the only thing controlled by the Plesk setting, and you can set
iptables -P FORWARD DROPon boot, it should be ok … but, no guarantees.Current thinking is that we’ll split Docker’s rules out of the FORWARD chain into a new DOCKER-SOMETHING chain, where we can insert and append rules as we like.
The, as long as we make sure the jump to DOCKER-SOMETHING is at the top of the FORWARD chain, it shouldn’t matter if other applications append to the FORWARD chain before/after docker networks are added.
That should help with this, the Oracle Cloud issue, and probably the swag issue.
I also just ran into this with an
unattended-upgradeonUbuntu 24.04which breaks external connectivity to published ports on swarm.The packets are being dropped in
DOCKERchain in the new set of iptables rules: https://github.com/moby/moby/blob/master/integration/network/bridge/iptablesdoc/generated/swarm-portmap.md?plain=1#L29In prior versions, this rule does not exist and no drops happen here. With the refactoring of rules, this rule seems unnecessary.
for anyone looking for a workaround, just removing that first
DROPrule fromDOCKERchain or flushing this chain should do the trick.Same here with Docker v28. i dint think its related to DNS. I cant even Ping a Tailscaledevice from inside a Docker container. With V27.5.1 it works fine
This is our fix in the cloud-init that creates new Docker Swarm nodes (Ubuntu 22.04)
Apologies in advance if this should be a separate issue as this isn’t related to tailscale but rather iptables.
After updating to Docker v28 all containers lost network access, I found that Oracle Cloud had generated persistent iptables rules (
/etc/iptables/rules.v4), one of the rules-A FORWARD -j REJECT --reject-with icmp-host-prohibitedwas responsible for blocking Docker traffic.It seems that on Docker v27 network forward rules are added before this REJECT but on Docker v28 they are now added after. Note: br-local is a custom bridge network.
Docker v27.5.1
Docker v28.0.0
(Postclose comment)
I’m pleased to report that we applied 28.0.1 to our problematic issue (Internal routing between Swag (https proxy) and bespoke http service on rocky9), and this version IS WORKING.
It seems that the issue affecting tailscale was the same as was also affecting us after all, so we’re happy to be fixed as collateral.
Cheers
Hi @francescor - 28.0.1 is likely to fix the issues … I’d recommend waiting for it (later today or tomorrow).
Same here. I haven’t even downgraded or touched the iptables, and 28.0.1 fixed the problem. Now I can upgrade my other hosts.
As workaround for avoid the docker downgrade I found this solution: Set a special role on firewall configuration of our servers, allowing a forward for everything through the source 172.16.0.0/12.
Then restart docker service by:
service docker restartAnd then restart your containers. And everything back to work properly.
Hi @maxexcloo - thank you for the update … we’ll get this fixed by moving most of Docker’s rules out of the FORWARD chain.
For the Tailscale issue, some progress … I can repro the issue by running
tailscale set --stateful-filteringat the client-container end.It adds rule
-A ts-forward -o tailscale0 -m conntrack ! --ctstate RELATED,ESTABLISHED -j DROP(which is the one dropping packets in your dump @Delta1977, so I think you must have that setting - but it’d be good to confirm).Running tailscale down/up on 27.5.1 without a moby restart causes the same problem, because the jump to
ts-forwardends up at the top of the FORWARD chain. I’m not sure a simple rearrangement of the moby 28.0 rules will fix this one (as it should for some of the other issues here), but at least I can experiment now.(Quick comment after a skim, please disregard if not linked). Suspicion this is not tail-scale only, or there are two issues with 28.0.0 that affect internal routing.
We had an issue between swag and a http host losing internal routing this morning following an update of docker from 27.x to 28.x (We keep this patched daily as it’s internet exposed).
Flushing nftables, restarting the vm, restarting the containers, re-deploying the containers - none of it helped. The only thing that fixed for us was reverting the entire vm back to before the upgrade to 28.0.0
We verified it was the upgrade that was at fault by repeating it manually, and docker stopped routing internally as soon as it was restarted.
We checked nftables’ rules (host was rocky 9) and they looked correct, with the correct external ports.
what also helps me is just flushing all the rules before upgrading to 28, that fixes the ordering of the rules in FORWARD and
INGRESSrules end up near the top. It might help in your case as well @lxgaming