tailscale: [Android Beta Client] cannot ping (and connect to) other devices in tailnet through Android client

What is the issue?

When connected to self-hosted Headscale instance android client cannot ping nor initiate connections to other devices on tailnet. (Checked with Termux ping command, Ping tools and CX file explorer for SMB and ConnectBot for SSH).

The only scenario I was able to get a ping was when pinging exit node that the android client was currently using.

Other devices in tailnet can ping android client without issues all the time.

No ACL is present.

Steps to reproduce

  1. Build android client (see #11716 and tailscale/tailscale-android#325 Download Android Beta Client 1.65.4-t7a77a2edf-gf95428f7fa4 from Play Store.
  2. Login to self hosted tailscale instance.
  3. Enable tailscale.
  4. Try to ping other device in tailnet from Android client (fails).
  5. Enable exit node.
  6. Try to ping currently used exit node from android client (successful).

Are there any recent changes that introduced the issue?

Android beta client, self built beta app.

OS

Android

OS version

Android 14

Tailscale version

1.65.0-t220764331-g50bb25aca2d (with tailscale/tailscale-android#325) 1.65.4-t7a77a2edf-gf95428f7fa4

Other software

Headscale v0.23.0-alpha5 (also tested with v0.22.3)

Bug report

BUG-NO-LOGS-NO-SUPPORT-this-node-has-had-its-logging-disabled

I’m more than happy to provide logs in other way, given instructions how.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 22 (5 by maintainers)

Commits related to this issue

Most upvoted comments

When compering logs from when connected to headscale and tailscale server something caught my eye (both servers have a few nodes connected):

Headscale: 04-18 09:09:41.835 2003 3673 D ConnectivityService: registerNetworkAgent NetworkAgentInfo{network{107} handle{462967197709} ni{VPN CONNECTING extra: VPN:com.tailscale.ipn} created=2024-04-18T07:09:41.835Z Score(Policies : IS_UNMETERED&IS_VPN ; KeepConnected : 0) lp{{InterfaceName: tun0 LinkAddresses: [ 100.64.0.4/32,fd7a:115c:a1e0::4/128 ] DnsAddresses: [ ] Domains: MTU: 1280 Routes: [ 100.100.100.100/32 -> 0.0.0.0 tun0 mtu 0 ]}} nc{[ Transports: VPN Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED TransportInfo: <VpnTransportInfo{type=1, sessionId=null, bypassable=false longLivedTcpConnectionsExpensive=false}> Uids: <{0-10444, 10446-10469, 10471-20444, 20446-20469, 20471-99999}> OwnerUid: 10726 AdminUids: [10726] UnderlyingNetworks: Null]} factorySerialNumber=6}

Tailscale’s server: 04-18 09:10:26.069 2003 2106 D ConnectivityService: registerNetworkAgent NetworkAgentInfo{network{109} handle{471557132301} ni{VPN CONNECTING extra: VPN:com.tailscale.ipn} created=2024-04-18T07:10:26.069Z Score(Policies : IS_UNMETERED&IS_VPN ; KeepConnected : 0) lp{{InterfaceName: tun0 LinkAddresses: [ 100.103.30.79/32,fd7a:115c:a1e0::ed01:1e4f/128 ] DnsAddresses: [ /100.100.100.100 ] Domains: tail43353.ts.net rednas.ovh MTU: 1280 Routes: [ 100.76.31.70/32 -> 0.0.0.0 tun0 mtu 0,100.87.172.75/32 -> 0.0.0.0 tun0 mtu 0,100.91.28.81/32 -> 0.0.0.0 tun0 mtu 0,100.119.22.118/32 -> 0.0.0.0 tun0 mtu 0,fd7a:115c:a1e0::/48 -> :: tun0 mtu 0,100.100.100.100/32 -> 0.0.0.0 tun0 mtu 0 ]}} nc{[ Transports: VPN Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED TransportInfo: <VpnTransportInfo{type=1, sessionId=null, bypassable=false longLivedTcpConnectionsExpensive=false}> Uids: <{0-10444, 10446-10469, 10471-20444, 20446-20469, 20471-99999}> OwnerUid: 10726 AdminUids: [10726] UnderlyingNetworks: Null]} factorySerialNumber=6}

Seems like when connected to Headscale server the app doesn’t create routes: headscale: Routes: [ 100.100.100.100/32 -> 0.0.0.0 tun0 mtu 0 ] tailscale: Routes: [ 100.76.31.70/32 -> 0.0.0.0 tun0 mtu 0,100.87.172.75/32 -> 0.0.0.0 tun0 mtu 0,100.91.28.81/32 -> 0.0.0.0 tun0 mtu 0,100.119.22.118/32 -> 0.0.0.0 tun0 mtu 0,fd7a:115c:a1e0::/48 -> :: tun0 mtu 0,100.100.100.100/32 -> 0.0.0.0 tun0 mtu 0 ]

Okay, the problem is that we’re passing the ControlURL as part of ipn.Notify.UpdatePrefs in the call to the start API. This has the effect of setting prefs that don’t enable single IPs nor subnet routes, so as a result, none of the peer’s AllowedIPs make it into our routes.

This was not a problem with the old client because it didn’t use that option, it manually updated prefs.

Old

state.Prefs.ControlURL = e.URL
				b.backend.SetPrefs(state.Prefs)
				// Need to restart to force the login URL to be regenerated
				// with the new control URL. Start from a goroutine to avoid
				// deadlock.
				go func() {
					err := b.backend.Start(ipn.Options{})
					if err != nil {
						fatalErr(err)
					}
				}()

New

Client(viewModelScope).addProfile { addProfile ->
      addProfile.onFailure(fail).onSuccess {
        prefs.ControlURL = controlURL
        val options = Ipn.Options(UpdatePrefs = prefs)
        login(options, completionHandler)
      }
    }

Issue still present on 1.65.95-t71e9258ad-g5ea9a50ba57

OK for some reason it worked after a clean reinstall.

@K900 try login out and back it. I’ve tested just now with 1.66.0-te2a0fc0bc-g6bd50e8026d and it works. If still no luck try clearing app data and log again.

@Ziomal12 We’re chasing down some lingering problems in this area right now, so we can leave this ticket open. Thanks for trying out these new builds and finding these issues!