fix(desktop): a NetBird address is offered for pairing as a VPN endpoint #41655
main fromrefs/pull/41655/head·merged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubRefs #41053
Problem#
Since #15753 stopped labelling other VPNs' addresses as Tailscale, a desktop host that runs NetBird (a non-Tailscale 100.64.0.0/10 VPN) and no Tailscale offers no pairing address for it. The address is dropped rather than listed.
Fix#
A 100.64.0.0/10 address that is not Tailscale's is listed as a VPN IP endpoint, but only on a host that shows no Tailscale identity. A stopped Tailscale does not count as one: tailscale status still reports the last netmap it had, and on Linux tailscale0 stays up with only a link-local address, so a tailscale* interface counts only while it carries a tailnet IPv4. Each VPN address gets its own default key, so setting one as default no longer marks the others. Hosts that run Tailscale still exclude other VPNs' addresses.
Known limit: on a host without Tailscale, an unclaimed CGNAT address is listed as a VPN IP even when it is a carrier address, because the address alone does not show its network. Before #15753 every such address was labelled Tailscale, so this changes the label, not what is offered.
Related: #41054 covers the device side, where a device paired over a VPN address learns the LAN route. This PR is the desktop side.
Evidence#
Linux desktop app built at 4bebb45 (vp run build:desktop), run under Xvfb. The desktop host and a second peer are Docker containers joined to a self-hosted NetBird 0.84.0 server (embedded IdP, setup key). NetBird gave the host wt0 100.68.35.134 and the peer 100.68.139.120. For the Tailscale cases, Tailscale 1.104.7 runs on the same host, logged in to a local headscale. The "before" views are the same host running the base commit b5e1f91cba, or 61e9eeb for the stopped-Tailscale case.
NetBird, no Tailscale. Before (b5e1f91cba), Sharing & access lists This machine and Local network only. After, it also lists VPN IP http://100.68.35.134:3773/.
Pairing through the NetBird address. VPN IP set as default, then Create link gave http://100.68.35.134:3773/pair#token=…. Chrome on the other NetBird peer opened it and landed in the host's app. The desktop then lists the peer as an authorized client at its NetBird address, 100.68.139.120. It was paired twice from that peer, once with no Tailscale and once with Tailscale stopped. The browser paired this way is a web client of the host at http://100.68.35.134:3773, and its own Create link also gives links on that address. The endpoint picker is desktop-only.
Stopped Tailscale on a real host. After tailscale down, tailscale status --json reports "BackendState":"Stopped" and still lists 100.64.0.1, and tailscale0 keeps only fe80::…. At 61e9eeb the NetBird address was still hidden, because the interface name alone counted as Tailscale. At 4bebb45 it is listed. Tailscale installed but logged out (NeedsLogin) went the same way: hidden at 61e9eeb, listed at 4bebb45.
With Tailscale running (tailscale up), only the Tailscale IP is listed, as before. tailscale down brings the VPN IP back.
Two VPN addresses, each with its own default. A second NetBird client on the same host added wt1 100.68.125.43. Before the key fix (4bebb45 with only ConnectionsSettings.logic.ts reverted to cdc63b8), setting 100.68.125.43 as default marked both VPN rows Default. At 4bebb45 only the chosen address is marked, and choosing the other moves the mark.
macOS desktop app, Tailscale on. This is a regression check for a host that runs Tailscale. The endpoint list is byte-identical before and after: This machine, Local network, Tailscale IP, and Tailscale HTTPS (unavailable). No VPN row. It was run at 593e11d. The later commits change the stopped-Tailscale path, the VPN key, and how an interface named tailscale* is recognised. macOS Tailscale uses a utun interface, which is recognised by its fd7a:115c:a1e0:: address, and that check is unchanged, so this view still holds.
Not shown:
- Not shown: the Windows desktop app. The Windows test VM could not start: its host was at its memory limit with other test devices for the whole hour the run waited. The endpoint code is shared across platforms, but NetBird's Windows adapter and a stopped Tailscale's Windows adapter were not checked.
- Not shown: a real NetBird address or a stopped Tailscale on macOS. The macOS host runs Tailscale in daily use, and it was not changed.
- Not shown: pairing the mobile app through a VPN address. That is the device side, #41054.
Tests#
vp run check:changedpasses on4bebb45: format, lint, knip, typecheck,tailscaleEndpointProvider.test.ts,ConnectionsSettings.logic.test.ts, and the React compiler check.- The stopped-Tailscale case in
tailscaleEndpointProvider.test.tsuses the interface shape seen on the real host:tailscale0with a link-local address only. It fails at61e9eeband passes at4bebb45. The VPN-key case inConnectionsSettings.logic.test.tsfailed on the commit before its fix.
Claude Haiku 5.5 and Claude Opus 5.5, Claude Code (in T3 Code)
🤖 Generated with Claude Code
- 1
- 2
- 3
Pushed4bebb45
Pushed350fcd6
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.