fix(connect): Cloudflare and other VPN addresses no longer show as Tailscale #17158
Mergedshivamhwp(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/17158/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- docs/user/remote-access.md lines 68 to 69OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -64,8 +64,6 @@64646565 ### Reach one machine several ways666667-A machine can have more than one route: LAN, Tailscale, a public URL, SSH, or68-T3 Connect. To add one, choose **Add route** in the machine's route list, or69-next to it in the T3 Connect list. Pairing the same machine again over another70-address also adds a route instead of a second machine. A new route is placed by71-speed, in that order, and you can reorder routes at any time.67+A machine can have more than one route: LAN, Tailscale, another VPN, a public68+URL, SSH, or T3 Connect. An address from a VPN other than Tailscale, such as69+Cloudflare WARP, shows as VPN. To add a route, choose **Add route** in the@@ -85,12 +85,17 @@85- * A Tailscale address: a MagicDNS name, the 100.64.0.0/10 range Tailscale86- * assigns, or its IPv6 range fd7a:115c:a1e0::/48.85+ * A name or address only Tailscale uses: a MagicDNS name or its IPv6 range86+ * fd7a:115c:a1e0::/48. Its IPv4 addresses come from the shared 100.64.0.0/1087+ * range, so they prove nothing on their own.8788 */8889 export const isTailnetHost = (host: string): boolean => {8990 const normalized = normalizeHostname(host);9091 if (normalized.endsWith(".ts.net")) return true;91- const parts = parseIpv4Address(normalized);92- if (parts !== null) return parts[0] === 100 && parts[1]! >= 64 && parts[1]! <= 127;9392 const ipv6 = parseIpv6Address(normalized);9493 return ipv6 !== null && ipv6PrefixMatches(ipv6, [0xfd7a, 0x115c, 0xa1e0, 0, 0, 0, 0, 0], 48);9594 };969596+/**97+ * An IPv4 address in 100.64.0.0/10. Tailscale, Cloudflare WARP and Mesh, other98+ * VPNs, and carrier-grade NAT all assign from this range.99+ */100+export const isSharedAddressSpaceHost = (host: string): boolean => {101+ const parts = parseIpv4Address(host);
- @@ -265,7 +285,10 @@265285 return url === null || isLearned(route) ? [] : [normalized(url)];266286 }),267287 );268- const kept = saved.filter((route) => {269- if (!isLearned(route)) return true;288+ const kept = saved.flatMap((route): ReadonlyArray<ConnectionRoute> => {270289 const url = routeHttpBaseUrl(route);271- if (url === null || !reported.has(normalized(url)) || known.has(normalized(url))) return false;290+ if (!isLearned(route)) {291+ return [292+ url === null || !reported.has(normalized(url))293+ ? route294+ : withNetwork(route, tailscaleOrigins.has(normalized(url))),
shivamhwp(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed