# St+Tailscale+Tasker(Android)?

**URL:** https://forum.syncthing.net/t/st-tailscale-tasker-android/22192
**Category:** Android
**Created:** [May 27, 2024, 6:16am UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192 "2024-05-27T06:16:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![sejtam](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@sejtam](https://forum.syncthing.net/u/sejtam)
#### Post date: [May 27, 2024, 6:16am UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/1 "2024-05-27T06:16:31Z")

</div>

The run conditions look useful, but a bit crude. While I appreciate the ability to run ST (Android) when logged into a given Wifi network, I would also like to be able to sync in certain other conditions.

WOuld it be possible to maybe

- detect when tailscale is connected (and then run syncthing)
- detect when a TS is connected _and_ a connected device is reachable via it?

COuld this be done vis Tasked (with a set of intents that Tasker csna use to start,enable,pause, stop ST fully or enable/disable certain devices etc?)

Alterntively, is there maybe a widget or easy/simple way to toggle ST when one needs it (and then to ignore the run conditions)?

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [May 27, 2024, 5:11pm UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/2 "2024-05-27T17:11:47Z")

</div>

> [@sejtam](#):
>
> The run conditions look useful, but a bit crude. While I appreciate the ability to run ST (Android) when logged into a given Wifi network, I would also like to be able to sync in certain other conditions.

Is the end goal to try to conserve battery power and/or to ensure that Syncthing uses only the tailnet?

---

<div class="post-metadata">

### Author: ![sejtam](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@sejtam](https://forum.syncthing.net/u/sejtam)
#### Post date: [May 28, 2024, 2:24am UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/3 "2024-05-28T02:24:46Z")

</div>

The goal is to sync on the local LAN if I’m at home, but to also be able to use the Tailnet if I’, outside and my Android is connected to the Tailnet, but not to bother (and thus save battery) when it is not

Also: does ST handle clients having mode than one address (one LAN IP, and one for the Tailnet)?

---

<div class="post-metadata">

### Author: ![sejtam](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/s/9de053/32.png) [@sejtam](https://forum.syncthing.net/u/sejtam)
#### Post date: [May 28, 2024, 4:01am UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/4 "2024-05-28T04:01:59Z")

</div>

s/mode/more/. sigh.

It would be nice to determine a sequence of addresses to check in order (and which to check und er which conditions) so, if I am home (a=nd connected to one of my Wifi networks, and Tailscale is still ‘on’):

- if connected to Wifi Home 12: use addresses n 192.168.0.0/24, 172.16.0.0/12
- if connected to Home-Wifi-2 : use addresses 192.168.0.0/24 only
- if connected to Tailscale (ie Tailscale is ON): use addresses in xxx.xxx…0.0/16. or such?

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [May 28, 2024, 4:45pm UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/5 "2024-05-28T16:45:15Z")

</div>

> [@sejtam](#):
>
> The goal is to sync on the local LAN if I’m at home, but to also be able to use the Tailnet if I’, outside and my Android is connected to the Tailnet, but not to bother (and thus save battery) when it is not

While on your home LAN, Syncthing’s local discovery broadcasts will find and connect using your private IP addresses (assuming your host and/or router [firewalls](https://docs.syncthing.net/users/firewall.html) allow it).

While away from home, if you aren’t port forwarding your home device(s) for direct connections from the internet, and your tailnet is configured to allow access on port 22000, your Android phone should automatically find your home device at its static CGNAT address (100.x.x.x) assigned by Tailscale because local discovery won’t result in a connection via a private IP address (e.g. 192.168.x.x) and your home device(s) will have provided their tailnet addresses to the [Syncthing discovery servers](https://docs.syncthing.net/users/stdiscosrv.html).

When your Android device is disconnected from your tailnet, Syncthing might end up using a [Syncthing relay server](https://docs.syncthing.net/users/strelaysrv.html). If you only want it to use the tailnet or home LAN, easiest solution is to disable [relaying](https://docs.syncthing.net/users/relaying.html). Then Syncthing will just periodically check for a link similar to how the Wi-Fi run conditions work.

> [@](#):
>
> Also: does ST handle clients having mode than one address (one LAN IP, and one for the Tailnet)?

Yes, by default Syncthing dynamically binds to all available network interfaces.

For more details: [https://docs.syncthing.net/users/config#listen-addresses](https://docs.syncthing.net/users/config#listen-addresses)

The [allowedNetworks](https://docs.syncthing.net/advanced/device-allowednetworks.html) setting provides additional granularity.

---

<div class="post-metadata">

### Author: ![gadget](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/dec6dc/32.png) [@gadget](https://forum.syncthing.net/u/gadget)
#### Post date: [May 28, 2024, 5:02pm UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/6 "2024-05-28T17:02:16Z")

</div>

> [@sejtam](#):
>
> It would be nice to determine a sequence of addresses to check in order (and which to check und er which conditions) so, if I am home (a=nd connected to one of my Wifi networks, and Tailscale is still ‘on’):
> 
> - if connected to Wifi Home 12: use addresses n 192.168.0.0/24, 172.16.0.0/12
> - if connected to Home-Wifi-2 : use addresses 192.168.0.0/24 only
> - if connected to Tailscale (ie Tailscale is ON): use addresses in xxx.xxx…0.0/16. or such?

As far as I’m aware of neither the official Syncthing Android app (which is no longer receiving any feature upgrades) or Syncthing-Fork specifically offer that level of granularity in their respective UIs, but the default Syncthing settings, disabling relaying, and perhaps combining it with the `allowedNetworks` and `listenAddress` settings results in the connection behavior you described.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [June 27, 2024, 5:02pm UTC](https://forum.syncthing.net/t/st-tailscale-tasker-android/22192/7 "2024-06-27T17:02:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
