by k4n3n4s k4n3n4s
Version 1 (August 26, 2021)
Download (706 downloads)
No Premium required.
App required for this Flow: WireGuard.
This Flow automatically connects or disconnects the WireGuard VPN (by controlling the WireGuard App) based on current WiFi connectivity.
Also, re-establishes the WireGuard VPN connection when lost.
Prerequisites
* Automate > Settings > Privileges > control WireGuard tunnels
* WireGuard > Settings > Allow remote control apps
* Android > Settings > Applications > Wireguard > Battery > Disable battery optimization option
Customisation
* Block 35: Replace the string: your_VPN_name with the name of your WireGuard VPN tunnel.
* Block 34: Replace the IP 192.168.1.1 with an actual ping-able IP of your LAN. This is required in order to be possible for this Flow to check if the VPN connection is OK.
* Block 13: Use the "PICK NETWORK" button to pick a network (usually your home WiFi network). When your phone connects to the selected network, this Flow will disconnect the WireGuard VPN. When your phone disconnects from the selected network, this Flow will connect the WireGuard VPN.
* Block 19: You can use this as Block 13, but for a 2nd network. If you don't need this, you can just leave it as is.
* Block 42: You can set how often this Flow will ping your LAN in order to check the VPN connection status (and reconnect if the connection is lost).
* I recommend to disable the Logging for this Flow (from Automate menu). By this way you will see in the Log only the reconnection attempts of this Flow (and you will have an overview of how often your VPN connection is lost).
Special thanks to
https://llamalab.com/automate/community/flows/37347
and to Christoph Rechtlehner for his comment in that flow.
5 stars | 2 | |
4 stars | 0 | |
3 stars | 0 | |
2 stars | 0 | |
1 star | 0 | |
Reports | 0 |
Rate and review within the app in the Community section.