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
{{ message }}
Repository navigation
[Bug]: Client tears down a healthy Tailscale socket to "upgrade" to LAN, then falls back — remote connections flap #24516
When a remote client has both a LAN and a Tailscale route to the same environment (the server is network-accessible on 0.0.0.0, so DirectEndpoints advertises both), the client keeps tearing down a healthy Tailscale WebSocket to "upgrade" to LAN. The LAN connection then doesn't establish, the client falls back to Tailscale, and the cycle repeats after the route cooldown. From the user's side, remote connections look unreliable: frequent disconnects and resyncs.
While on a non-best route, better routes are preflighted every 60 seconds (and on wake/network change). The first successful preflight emits BetterRouteAvailable.
BetterRouteAvailable returns reset, closing the current socket before the new route is known to work.
If the established route isn't the preferred one, the preferred route gets a 3e5 (5 min) cooldown, after which the loop repeats.
Expected
Make-before-break: keep the current socket until the better route has fully connected (ticket, upgrade, initial sync), then switch.
A route that passes preflight but fails to establish should back off longer (exponential) instead of a fixed 5 min.
Another case of this switching, on stable 0.1.7. Two points differ from the original report:
The "LAN" route is not on the client's LAN. The remote's home address (192.168.0.x) is reachable from the client only through a Tailscale subnet route. The remote is in another country. Both routes have the same round trip of about 260 ms. The client still ranks the subnet-routed address as lan (rank 1) above the direct tailnet route (rank 2).
Both routes connect successfully, and the client still switches. Every switch to the lan route connects (preflight 200, websocket ticket 200, sync). About 60 seconds later the client switches back to the Tailscale route. About 4 minutes after that, it switches to lan again. A make-before-break change would hide each reset, but the client would still switch, resubscribe, and resync twice every 5 minutes.
Area: apps/web (client connection runtime) Impact: Major degradation or frequent failure. Each switch interrupts all subscriptions for 1 to 3 seconds. Version: desktop 0.1.7 stable, macOS arm64 client and server, server network-accessible, paired with T3 Connect.
Steps to reproduce
Run the server network-accessible on host A. Host A has a LAN address and a Tailscale address.
On another node on host A's LAN, advertise host A's LAN address as a Tailscale subnet route.
On client B, on a different network, accept Tailscale routes and pair with host A.
When Tailscale is stopped on the client, both preflights time out and the client stays on the T3 Connect relay with no switches.
Workaround: on the subnet router, drop TCP 3773 to the routed address (iptables -t raw -I PREROUTING -i tailscale0 -d <addr> -p tcp --dport 3773 -j DROP). Then only the Tailscale route passes preflight. I watched the client for 11 minutes after this change and it did not switch.
The suggestion above to treat a direct Tailscale path as equal to LAN would also fix this case. Would you accept a PR for that? One option: switch to a higher-ranked route only when its measured preflight time is clearly lower than the active route's.
Activity
woahitsraj commentedon Nov 9, 2026
Another case of this switching, on stable
0.1.7. Two points differ from the original report:192.168.0.x) is reachable from the client only through a Tailscale subnet route. The remote is in another country. Both routes have the same round trip of about 260 ms. The client still ranks the subnet-routed address aslan(rank 1) above the directtailnetroute (rank 2).lanroute connects (preflight 200, websocket ticket 200, sync). About 60 seconds later the client switches back to the Tailscale route. About 4 minutes after that, it switches tolanagain. A make-before-break change would hide each reset, but the client would still switch, resubscribe, and resync twice every 5 minutes.Area: apps/web (client connection runtime)
Impact: Major degradation or frequent failure. Each switch interrupts all subscriptions for 1 to 3 seconds.
Version: desktop
0.1.7stable, macOS arm64 client and server, servernetwork-accessible, paired with T3 Connect.Steps to reproduce
network-accessibleon host A. Host A has a LAN address and a Tailscale address.Client trace (addresses redacted)
When Tailscale is stopped on the client, both preflights time out and the client stays on the T3 Connect relay with no switches.
Workaround: on the subnet router, drop TCP 3773 to the routed address (
iptables -t raw -I PREROUTING -i tailscale0 -d <addr> -p tcp --dport 3773 -j DROP). Then only the Tailscale route passes preflight. I watched the client for 11 minutes after this change and it did not switch.The suggestion above to treat a direct Tailscale path as equal to LAN would also fix this case. Would you accept a PR for that? One option: switch to a higher-ranked route only when its measured preflight time is clearly lower than the active route's.