[Bug] Can't always connect to Heascale through data (lte/4g) without passing via wifi first #720

Closed
opened 2025-12-29 02:22:49 +01:00 by adam · 9 comments
Owner

Originally created by @markcst on GitHub (May 31, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Probably it's me and I can't figure out how Headscale (btw nice piece of sw) works but this is what happens and idk if it's normal:

  1. I connect to the home wifi (in which my Headscale is active and operative) with my phone (Android or iOS)
  2. My Headscale paired device log in the Headscale network
  3. I turn off the wifi, then I enable the data: I remain connected to the Headscale network and I can use data instead of wifi to remotely access my home network services
  4. BUT if I turn off the connection in the Tailscale app (or I reboot the phone*), and turn it on again (all of this while using only data), I cannot reconnect to my Headscale network using only the data connection
  5. Then I have to reconnect to the home wifi to be able again to connect to the Headscale network. As you know right, this is impossible while I'm away

*(I'm not sure if this it's always the case when rebooting the phone)

Currently, these are my nodes
immagine

And these are my routes
immagine

Idk if this too is normal but: when I paired my devices, none of them automatically appaired in the routes list, and I had to add them with the advertise command. I did this with my Linux PC (srv) and my Android phone (rn7-mrk) with the "Run as exit node" on this one. Off course I can't do this on iOS as the Tailscale doc says.
Idk if I have to at least advertise all nodes in the Headscale net to make it function properly and to avoid the problem above

Expected Behavior

I expect to be able to connect to the Headscale mesh network even using only the data connection, even after a disconnection from it through the toggle in the Tailscale app

Steps To Reproduce

  1. Connect to the Headscale mesh network using wifi (you have to already be paired to it)
  2. Disable wifi and use data connection
  3. Disconnect from the Headscale network (toggle of in the Tailscale app, or reboot the phone)
  4. Reconnect to the Headscale network using only the data connection
  5. You can't reconnect to it

Environment

- OS: Debian GNU/Linux trixie x86_64 (Headscale server)
- Headscale version: 0.23.0-alpha12
- Tailscale version: 1.66.3 on Android/iOS, 1.66.4 on Linux PCs

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

No response

Originally created by @markcst on GitHub (May 31, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior Probably it's me and I can't figure out how Headscale (btw nice piece of sw) works but this is what happens and idk if it's normal: 1. I connect to the home wifi (in which my Headscale is active and operative) with my phone (Android or iOS) 2. My Headscale paired device log in the Headscale network 3. I turn off the wifi, then I enable the data: I remain connected to the Headscale network and I can use data instead of wifi to remotely access my home network services 4. BUT if I turn off the connection in the Tailscale app (or I reboot the phone*), and turn it on again (all of this while using only data), I cannot reconnect to my Headscale network using only the data connection 5. Then I have to reconnect to the home wifi to be able again to connect to the Headscale network. As you know right, this is impossible while I'm away *(I'm not sure if this it's always the case when rebooting the phone) Currently, these are my nodes ![immagine](https://github.com/juanfont/headscale/assets/83904681/9d6f0f0f-5eb5-4d3f-89bf-9e5d5d781717) And these are my routes ![immagine](https://github.com/juanfont/headscale/assets/83904681/98e7306b-2865-4d2b-89a8-ad6ed5a70643) Idk if this too is normal but: when I paired my devices, none of them automatically appaired in the routes list, and I had to add them with the advertise command. I did this with my Linux PC (`srv`) and my Android phone (`rn7-mrk`) with the "Run as exit node" on this one. Off course I can't do this on iOS as the Tailscale doc says. Idk if I have to at least advertise all nodes in the Headscale net to make it function properly and to avoid the problem above ### Expected Behavior I expect to be able to connect to the Headscale mesh network even using only the data connection, even after a disconnection from it through the toggle in the Tailscale app ### Steps To Reproduce 1. Connect to the Headscale mesh network using wifi (you have to already be paired to it) 2. Disable wifi and use data connection 3. Disconnect from the Headscale network (toggle of in the Tailscale app, or reboot the phone) 4. Reconnect to the Headscale network using only the data connection 5. You can't reconnect to it ### Environment ```markdown - OS: Debian GNU/Linux trixie x86_64 (Headscale server) - Headscale version: 0.23.0-alpha12 - Tailscale version: 1.66.3 on Android/iOS, 1.66.4 on Linux PCs ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Anything else? _No response_
adam added the stalebug labels 2025-12-29 02:22:49 +01:00
adam closed this issue 2025-12-29 02:22:49 +01:00
Author
Owner

@kradalby commented on GitHub (Jun 3, 2024):

did you have this issues with the prior stable version (0.22.3)?

@kradalby commented on GitHub (Jun 3, 2024): did you have this issues with the prior stable version (0.22.3)?
Author
Owner

@timmyb824 commented on GitHub (Jun 6, 2024):

Just wanted to mention that I recently began configuring headscale as a transition from tailscale. I experimented with this specific situation using my iPhone and encountered the same problem. It didn't connect over cellular, so I had to turn on wifi again for it to connect. Once connected, I can turn off wifi and it seems to work fine over cellular. I'm running headscale (v0.22.3) in a Proxmox LXC. iPhone Tailscale client version is 1.66.3.

@timmyb824 commented on GitHub (Jun 6, 2024): Just wanted to mention that I recently began configuring headscale as a transition from tailscale. I experimented with this specific situation using my iPhone and encountered the same problem. It didn't connect over cellular, so I had to turn on wifi again for it to connect. Once connected, I can turn off wifi and it seems to work fine over cellular. I'm running headscale (v0.22.3) in a Proxmox LXC. iPhone Tailscale client version is 1.66.3.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 5, 2024):

This issue is stale because it has been open for 90 days with no activity.

@github-actions[bot] commented on GitHub (Sep 5, 2024): This issue is stale because it has been open for 90 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 12, 2024):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Sep 12, 2024): This issue was closed because it has been inactive for 14 days since being marked as stale.
Author
Owner

@Egleyser commented on GitHub (Sep 24, 2024):

Hi guys, I implemented the latest headscale with the latest client for iOS on an iPhone and iPad and the same thing happened on both. As mentioned by @timmyb824 enabling the VPN while on wifi and then turning it off makes the device connect to the advertised nodes and subnets.

@Egleyser commented on GitHub (Sep 24, 2024): Hi guys, I implemented the latest headscale with the latest client for iOS on an iPhone and iPad and the same thing happened on both. As mentioned by @timmyb824 enabling the VPN while on wifi and then turning it off makes the device connect to the advertised nodes and subnets.
Author
Owner

@markcst commented on GitHub (Dec 9, 2024):

No one else has this issue? What I'm doing wrong?

I simply disconnect the phone from the wifi, then use 4G data with the Tailscale (Headscale) VPN enabled and everything seems fine. Device appears as online in the nodes list. Then I turn off mobile data and VPN, I turn them back on after a while - in this whole time I didn't reconnect to the wifi - so I can't reconnect to the Headscale server.

In the Tailscale app, it shows that the device is connected, but it is not. Indeed looking at nodes list on the server it shows the device as offline. After a few seconds/minutes it shows that I'm disconnected on the Tailscale app too.

I'm on a Pixel 7a with Android 15, but same happens on other Android phones, and even on iPhone. @kradalby, any help?

@markcst commented on GitHub (Dec 9, 2024): No one else has this issue? What I'm doing wrong? I simply disconnect the phone from the wifi, then use 4G data with the Tailscale (Headscale) VPN enabled and everything seems fine. Device appears as `online` in the nodes list. Then I turn off mobile data and VPN, I turn them back on after a while - in this whole time I didn't reconnect to the wifi - so I can't reconnect to the Headscale server. In the Tailscale app, it shows that the device is connected, but it is not. Indeed looking at nodes list on the server it shows the device as `offline`. After a few seconds/minutes it shows that I'm disconnected on the Tailscale app too. I'm on a Pixel 7a with Android 15, but same happens on other Android phones, and even on iPhone. @kradalby, any help?
Author
Owner

@topshelf510 commented on GitHub (Feb 15, 2025):

Same exact issue, I thought headscale was not worth the hassle at all but now I'm thinking it might be the way I'm setting it up. Have yet to see any kind of documentation to help me with this either 😔

@topshelf510 commented on GitHub (Feb 15, 2025): Same exact issue, I thought headscale was not worth the hassle at all but now I'm thinking it might be the way I'm setting it up. Have yet to see any kind of documentation to help me with this either 😔
Author
Owner

@krofek commented on GitHub (Jun 23, 2025):

Hello, was trying out a few thing. Now seems to be working through mobile as it should.

It turns out the node is visible, because it is connected through Hs or ts network. But you cannot connect with mobile network because the local dns is not working correctly. That's why it works after connecting locally through wifi and then changing to movile. Locally the router routes internal routes and the setting stays on mobile and local node until disconnected.

So the fix is probably for most people with this problem the same. Fixing the node's dns service.

Issue url: https://tailscale.com/kb/1188/linux-dns

Tl;dr fix:

sudo apt install systemd-resolved

sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo ln /usr/bin/resolvectl /usr/bin/systemd-resolve

sudo systemctl restart systemd-resolved
sudo systemctl restart NetworkManage
sudo systemctl restart tailscaled

Don't know which symlink is the right one, dont have enough time to check out if it's the binary or config location. So I just used both, haha.

@krofek commented on GitHub (Jun 23, 2025): Hello, was trying out a few thing. Now seems to be working through mobile as it should. It turns out the node is visible, because it is connected through Hs or ts network. But you cannot connect with mobile network because the local dns is not working correctly. That's why it works after connecting locally through wifi and then changing to movile. Locally the router routes internal routes and the setting stays on mobile and local node until disconnected. So the fix is probably for most people with this problem the same. Fixing the node's dns service. Issue url: https://tailscale.com/kb/1188/linux-dns Tl;dr fix: ``` sudo apt install systemd-resolved sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf sudo ln /usr/bin/resolvectl /usr/bin/systemd-resolve sudo systemctl restart systemd-resolved sudo systemctl restart NetworkManage sudo systemctl restart tailscaled ``` Don't know which symlink is the right one, dont have enough time to check out if it's the binary or config location. So I just used both, haha.
Author
Owner

@FinMc commented on GitHub (Aug 12, 2025):

I'm also having this issue. Have headscale running on local server with internal local DNS routing with pihole and nginx. When i connect locally works fine. When disconnect from wifi to mobile data works as intended and able to access internal devices and pihole capabilites. But when i disconnect, close the app and relaunch I can no longer connect until I rejoin the wifi. Any tips would be great.
Not an android issue is it?

@FinMc commented on GitHub (Aug 12, 2025): I'm also having this issue. Have headscale running on local server with internal local DNS routing with pihole and nginx. When i connect locally works fine. When disconnect from wifi to mobile data works as intended and able to access internal devices and pihole capabilites. But when i disconnect, close the app and relaunch I can no longer connect until I rejoin the wifi. Any tips would be great. Not an android issue is it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#720