Have Tasker automatically connect/disconnect your VPN connection

DavidDavid

Getting comfortable
Joined
Jan 29, 2017
Messages
605
Reaction score
267
Location
Ohio
EDIT: Something updated recently and broke this solution. Follow the procedure here to make it work now...

FAQ regarding OpenVPN Connect Android | OpenVPN Access Server documentation

-----------------------------------------------------------------------------


If you have any intention to securely view your cameras remotely you should set up a VPN server on your home network. If you have any intention to not drive yourself crazy by 1) connect to VPN 2) open whatever camera app you have 3) view cameras then close app 4) disconnect from VPN each time you want to view them, then you should download Tasker and have it turn on your VPN when you leave your home WiFi and turn the VPN off when you get home. Alternatively, you can have Tasker connect and disconnect from your VPN when you open/close your camera viewing app if there's some reason you don't want to connect to your VPN all the time.

There has been a lot of talk about automation on this forum and VPN's lately, especially on @nayr 's VPN Primer for Noobs thread. This was so easy to set up it should be the first thing you do after getting your VPN connection working.

Use this link and follow the directions. Android: Protecting your network data from local snooping

Some general guidelines....
Type slowly. There are lots of ways to make a typo especially on a small touch screen.

While creating the first action, notice that there is actually a space between the : and your profile name. Extra: net.openvpn.openvpn.AUTOSTART_PROFILE_NAME: [Insert the Profile name you set]

I didn't need to set a delay, I suspect others might.

And finally, for some unknown reason, this app won't work unless you disable it and then re-enable it the first time. You only need to do this once. When on the main screen, look in the upper left you'll see a gear with a yellow lightening bolt thru it. The yellow means it's enabled. Unless you just installed it. Long press the gear and choose disable and the lightening bolt will go gray. Then immediately long press again to enable it and it'll turn gold. You're done.

I do not know if/how this would work on an iPhone since I've never owned one. Maybe someone else can chime in on that.
 
Last edited:
Top