easy way to use VPN automatically on iOS?

Confirmed that the OpenVPN Connect app now provides the Shortcut hooks to connect/disconnect to VPN. So you can do as above relying only on the OpenVPN client app.
 
I use Tasker on my Android devices to do this exact thing, but I'm not a iOS guy to know what might be comparable on that platform.

My Tasker task basically looks like this:

When the Tasker shortcut (an shortcut on the home screen with the BlueIris app icon - so it basically looks like the BlueIris app) is pressed........
- If NOT connected to my home wifi or my parent's wifi (we have a full time VPN connection between the two sites so while I'm at their house, I have full access to my system as if I was sitting at my home)​
- Launch OpenVPN and start my Home VPN connection​
- Wait 3 seconds (to ensure the connection is completed)​
- EndIf (so if I am at home or my parents home, the system skips the VPN connection and delay)​
- Launch the Blue Iris app (which is set to automatically login - which is why there is a delay because if the connection isn't completed, the app will complain it can't log in)​

I also have a "end task" that when the Blur Iris app is closed, it will close the VPN connection automatically

This means that within about 4 seconds of pressing the "BlueIris" icon on my home screen, I am looking at the camera feeds of my house - regardless of my location. When I move to or open another app, the connection is automatically ended.

This works perfectly and it is especially helpful on my wife's phone because she doesn't need to understand when and how to connect/disconnect to a VPN to see the cameras. It simply works when she presses the "BlueIris" icon on her home screen.
 
Last edited:
There's not really an equivalent of Tasker for IOS. At least not without jailbreaking. But you can do all of what you're doing in your example using shortcuts. Not as clean and simple as Tasker. You have to rely on various apps that enable more functions for shorcuts and functions within various VPN clients. The catch in OP's case is that the L2TP VPN is within system settings which are limited so there's not a way to access that one directly. You can for various others (as above) and build in various dependencies either in the shortcut or within settings in the VPN client app (e.g., on-demand connections and/or trusted networks for which VPN is enabled/disabled based on WiFi SSID/cell, geolocation, etc.).

That said, some things work better than others. e.g., Using WireGuard's on-demand function works perfectly using a browser. VPN comes up instantly. Not so great if you launch BI. Doesn't seem to pick up immediately that it needs the VPN. At least for me.
 
  • Like
Reactions: The Automation Guy