Blog 9 min read

The NAT rule we couldn't see: Tailscale, etcd, and iptables-legacy

Tailscale's invisible iptables-legacy NAT rule, a duplicate Talos hostname, and the conntrack cache that kept a correct fix from applying. Notes from growing slipway's cluster past one machine, and why cluster traffic now runs on kernel WireGuard.

Ben Soleimany
Founder
engineeringnetworking

Slipway ran on one physical machine for a surprisingly long time. Every Kubernetes node was a VM on that box, they all shared one internal bridge, and cross-node traffic never actually left the host. Networking in that world is easy. You can get a lot wrong and never find out.

Then we added a second machine, and a third, and found out.

A quick sketch of the setup as it stood during all of this, so the rest makes sense: each physical host runs Proxmox, the Kubernetes nodes are Talos VMs on top, and each host gives its VMs a small private subnet (10.10.0.x on the first box, 10.20.0.x on the second, 10.30.0.x on the third). The hosts reached each other over Tailscale, with each one advertising its private subnet as a route. Tailscale was already on the hosts for admin access, so extending it into the cluster path was the fastest way to grow past one machine while we were still building. So when a node on host two talked to a node on host one, the packet went VM, host, Tailscale tunnel, host, VM:

 slipway-cp-2        host 2 (Proxmox)        host 1 (Proxmox)       slipway-cp-1
+------------+       +-------------+         +-------------+       +------------+
|     VM     | vmbr1 |   bridge    |WireGuard|   bridge    | vmbr1 |     VM     |
| 10.20.0.4  |------>| 10.20.0.1   |-------->| 10.10.0.1   |------>| 10.10.0.4  |
+------------+       +-------------+ tunnel  +-------------+       +------------+

Before anyone reaches for the comment box: yes, that meant etcd peer traffic crossing a Tailscale tunnel between hosts. We measured the trade before accepting it: the hosts are close, and the connections were direct WireGuard, not DERP relays:

$ tailscale ping 10.30.0.4
pong from slipway-sf-03 (100.119.241.111) via [redacted]:41641 in 1ms

$ ping -c 2 10.30.0.4
64 bytes from 10.30.0.4: icmp_seq=1 ttl=64 time=0.190 ms
64 bytes from 10.30.0.4: icmp_seq=2 ttl=64 time=0.162 ms

The via <endpoint> rather than via DERP(...) is what says the path is direct; the endpoint is the one thing in this post we redacted. Round trips measured 0.2 to 2.5 ms depending on the host pair, on userspace wireguard-go at MTU 1280. etcd would be miserable over a real WAN, so measure your own numbers before copying anything here. And if your instinct right now is that a convenience mesh has no business in a production data path: agreed. Hold that thought until the end.

Most of the problems in this post live somewhere in the middle of that diagram.

Two machines, one hostname#

First, the easy one, which was entirely self-inflicted. Talos nodes are configured with a machine config file, and when we brought up the new worker we copied an existing config and edited it. Mostly edited it. The hostname stayed slipway-worker-3, which was already taken.

In Kubernetes, the node name is the hostname. Two machines with the same hostname do not show up as an error; they show up as one Node object that both machines believe is theirs. The node’s IP flapped between the two machines’ addresses, one of them sat permanently NotReady, and pods landed on whichever body the name happened to be wearing at that moment. Renaming the new node fixed it in a minute. Diagnosing it took a lot longer than a minute, because “one node keeps changing its IP” does not immediately read as “you have two nodes.”

The control plane that wouldn’t join#

The real fight started when we went from one control plane to three, with the new ones on the new hosts. Adding a control plane is normally boring: it boots, it joins etcd, the database Kubernetes keeps its state in, and it shows up in the node list with a control-plane role. Here is what we got instead:

$ kubectl get nodes
NAME               STATUS   ROLES           AGE     VERSION
slipway-cp-1       Ready    control-plane   5h2m    v1.36.1
slipway-cp-2       Ready    control-plane   4h40m   v1.36.1
slipway-cp-3       Ready    <none>          25m     v1.36.1
slipway-worker-1   Ready    <none>          4h58m   v1.36.1
slipway-worker-2   Ready    <none>          4h58m   v1.36.1
slipway-worker-3   Ready    <none>          4h39m   v1.36.1
slipway-worker-4   Ready    <none>          4h39m   v1.36.1
slipway-worker-5   Ready    <none>          4h31m   v1.36.1
slipway-worker-6   Ready    <none>          4h29m   v1.36.1

cp-3 is Ready. It is also, per its role column, not a control plane, and it stayed that way through every restart and every theory we had. That combination is what kept us going in circles: the kubelet could reach the API fine, the node pulled images, ran pods, passed every casual health check.

Asking etcd directly what it thought of its own membership:

$ talosctl -n 10.10.0.4 etcd members
NODE        ID                 HOSTNAME       PEER URLS                CLIENT URLS              LEARNER
10.10.0.4   5a40626c89e12971   slipway-cp-1   https://10.10.0.4:2380   https://10.10.0.4:2379   false
10.10.0.4   673e584d60295954                  https://10.20.0.4:2380                            true

cp-2 had limped in as a half-joined learner, no hostname, no client URL, before hitting the same wall. cp-3 not in the cluster at all. In the etcd logs on the receiving side, the same warning over and over:

{"level":"warn","caller":"embed/config_logging.go:185","msg":"rejected connection",
 "error":"tls: "100.109.112.75" does not match any of DNSNames ["slipway-cp-2"]
 (lookup slipway-cp-2 on 127.0.0.53:53: no such host)"}

while etcd on the joining node gave up at boot, every few seconds, for hours:

{"ts":"2026-06-20T23:34:20.581206Z","caller":"etcdserver/server.go:309","msg":"bootstrap failed",
 "error":"cannot fetch cluster info from peer urls: could not retrieve cluster
 information from the given URLs"}

We spent that evening on certificates, on Talos configs, on time sync, on everything except the network, because the network obviously worked. We fed the logs to an AI assistant too, which produced several confident theories that were each wrong in new and educational ways. What do you mean it can’t talk to etcd.

The thing we kept skimming past was the 100.109.112.75 in that reject. etcd peers verify each other with TLS certificates, and each certificate pins the node’s real address and hostname. 100.109.112.75 is not a node address. It is a Tailscale address, meaning the connection was arriving stamped as the host, not the node behind it. Something along the path was rewriting the packet’s source, the certificate check saw an impostor, and etcd did exactly what it should do with an impostor: it hung up.

Fine. So something is doing NAT where it should not. Find the rule, delete it. We manage each host’s firewall with nftables, and our masquerade rule, the bit of NAT that lets the VMs share the host’s address for outbound traffic, did need an exemption so that traffic bound for the other internal subnets keeps its real source. We added it. Still broken.

At this point nft list ruleset showed nothing, nothing at all, that could still be rewriting those packets. And yet they kept arriving rewritten.

The rule we were hunting was not in nftables. Tailscale, unless you tell it otherwise, installs its own NAT rules using iptables-legacy, a whole separate ruleset that nft list does not display. Here it is, the entire villain of this post:

-N ts-postrouting
-A POSTROUTING -j ts-postrouting
-A ts-postrouting -m mark --mark 0x40000/0xff0000 -j MASQUERADE

We had run Tailscale with --snat-subnet-routes=false, and tailscale status agreed the setting was on. To be precise about the claim: we are not saying the flag is broken, we are saying that on our hosts, with that flag set, this rule existed, matched our cross-host packets, and masqueraded them. Maybe the rule predated the flag and nothing cleaned it up; we did not tear the hosts down to find out. What we can say for certain is that the evening turned into two days of auditing one firewall while a second, invisible one did the rewriting.

The immediate fix was to exempt cluster traffic at the top of Tailscale’s own chain, then flush connection tracking:

iptables-legacy -t nat -I ts-postrouting 1 -s 10.0.0.0/8 -d 10.0.0.0/8 -j RETURN
conntrack -F

That second command matters more than it looks. NAT decisions are cached per connection: fix the rules, and established flows keep getting rewritten from cache anyway. We know because we watched it happen. With the RETURN rule in place and the ruleset visibly correct, the rejects kept scrolling, and conntrack was still holding entries like this:

tcp  6 2 CLOSE  src=10.30.0.4 dst=10.10.0.4 sport=38278 dport=2380
                src=10.10.0.4 dst=10.10.0.1 sport=2380 dport=38278 [ASSURED]

The first tuple is the connection cp-3 thinks it is making. The second is the reply path: answers addressed to 10.10.0.1, the host’s bridge address, because that is who the connection appeared to come from back when the entry was created. If you are wondering why this shows the bridge address while the TLS error showed a Tailscale one: a masquerade stamps the address of whatever interface the packet leaves through, so the same rewriting looks different depending on where you catch it. If you change NAT rules and the behavior does not change, flush conntrack before you conclude anything.

That got the third control plane into etcd. It was not durable, though: the RETURN rule lives in a chain Tailscale manages, so a tailscaled restart or a host reboot silently deletes it. The lasting fix was to take Tailscale out of the firewall business entirely:

tailscale set --netfilter-mode=off

One warning before anyone pastes that onto a remote machine: with netfilter-mode off, Tailscale adds no rules at all, including the accept rules that let tailnet traffic in. If your own firewall does not already cover the tailscale0 interface, that command can lock you out of the box you are fixing. Stage your own rules first, flip one host at a time, and do it after the cluster is healthy, not in the middle of etcd trying to converge.

The nested virt checkbox#

One more from the same expansion, cheap to state and easy to forget. Slipway runs tenant workloads in Kata microVMs, and a microVM inside a VM needs nested virtualization all the way down: the nested=1 flag on the host’s kvm module, and CPU type host on the VM so the guest actually sees the virtualization extensions. Nothing reminds you about either. The failure mode is quiet: the node joins, goes Ready, runs system pods happily, and the problem only shows up when a Kata pod lands on it and hangs in ContainerCreating, with the runtime failing to create the sandbox because /dev/kvm does not exist in the guest. If your workers are VMs, flip those switches before you need them.

What we actually learned#

If TLS between machines fails and the certificates are definitely right, stop rereading the certificates and start looking at source addresses. Mutual TLS pinned to real IPs turned out to be a very effective NAT detector. It refused to let broken networking limp along quietly, which is annoying in the moment and exactly what you want.

And on a Linux box, nft list ruleset is not the whole truth. If anything on the machine still speaks iptables-legacy, check that side too:

iptables-legacy -t nat -S

We run that after every firewall change on those hosts now, the way you glance at a door you already know you locked.

Tailscale for humans, WireGuard for machines#

Why was Tailscale in the cluster’s data path at all? Because it was already there. We ran it for admin access, and when the cluster outgrew one machine, advertising each host’s subnet into the mesh was one command per host. For standing up a multi-host cluster quickly while the product was still taking shape, it was genuinely great. Everything above is the bill.

The durable fix in June was taking Tailscale out of the firewall business. Later, once customers were on the platform, we took it out of the data path too. Cluster traffic now runs over a plain kernel WireGuard mesh: three peers, static endpoints, one small config file per host, no daemon anywhere near the packets. MTU went from 1280 to 1420, and the slowest host pair went from 2.5 ms to under half a millisecond. Tailscale still handles admin access, the job it was always best at.

The only hiccup during the move rhymed a little too well with everything above: one host had the new firewall rules written to disk but never loaded into the kernel. The file said one thing, the running ruleset said another, and traffic quietly fell back to the old path while everything looked fine. Some lessons you apparently pay for twice.

For anyone chasing the same log lines: Talos 1.13.4, Kubernetes 1.36.1, etcd 3.6.12, June 2026. The WireGuard migration: July 2026.

Last updated July 17, 2026

Ship your next pull request live.