Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: A macOS host running Tailscale is detected as a cloud VM, so its LAN address is never advertised #49709

OpenSkywingJam(GitHub profile, opens in a new tab) opened this issue 0 comments

Claude Opus 5.5 Writing the Issue on Behalf of Haochen

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Not a duplicate of

These are close but different:

  • #17246: unreachable virtual and VPN addresses get advertised as LAN routes. Here it's the opposite: the real LAN address is never advertised.
  • #34738 (closed): tailnet IPv6 endpoints were left out. Here the tailnet route is learned fine and the LAN route is missing.
  • #24516: the client switches from a working Tailscale socket to LAN and flaps. Here no LAN route exists to switch to.

The cause is specific to the cloud-VM check added in #24588, as described below.

Steps to reproduce

  1. On a macOS host, run T3 Code as the background service with the default private-network listener (t3 status shows Local network on).
  2. Run the standalone Tailscale client on the same host. Ours advertises a subnet route and an exit node.
  3. Connect a phone over T3 Connect, then use it at home on the same Wi-Fi with Tailscale off on the phone.

Expected behavior

The host is a home machine, not a cloud VM. It should report its LAN address in directEndpoints, and clients should learn a LAN route, as described in #15468 ("pairing once through T3 Connect is enough to use the LAN at home").

Actual behavior

The host reports only its tailnet address, so clients never learn a LAN route:

  • Desktop client: the route list is T3 Connect, Tailscale HTTPS, Tailscale ("found automatically") and SSH, with no LAN route.
  • Phone and tablet: at home they stay on the T3 Connect relay.

The cause is the cloud-VM check from #24588:

  • probeCloudMetadata treats any TCP connect to 169.254.169.254:80 within 300 ms as "this is a cloud VM".
  • resolveBoundEndpoints then keeps only tailnet addresses (!input.onCloudVm || tailscaleAddresses.has(address)).

On this host that connect succeeds, through Tailscale's tunnel:

$ route -n get 169.254.169.254 | grep interface
  interface: utun15        # Tailscale's utun
$ # TCP connect to 169.254.169.254:80 with a 300 ms timeout
connect OK

Confirmed by toggling Tailscale:

  1. tailscale down made the connect time out.
  2. Restarting the service then made it report the LAN address. Within seconds, the phone and tablet both showed LAN and connected to the host's LAN address directly.
  3. After tailscale up, they stayed on LAN, because the probe result is cached for the life of the process. The next service restart with Tailscale up drops the LAN route again.

A TCP connect alone can't tell a real metadata service from a tunnel that accepts the connection. One option is to also check for a metadata response, for example an HTTP request expecting a provider's metadata headers.

Impact

Minor bug or occasional failure

Version or commit

t3@0.1.14 (stable)

Environment

  • macOS 15.7.8 (Apple Silicon).
  • T3 Code background service (launchd).
  • Tailscale 1.106.3 (standalone macOS client), advertising a subnet route and an exit node.
  • Clients: iOS app (iPhone and iPad), macOS desktop app.
  1. tanstack-source added labelsbug

Sign in to join this conversation.