iOS VPN Connection Toggle Shortcut

Published by Christian Mohn · Read in about 2 min (337 words)

I have probably been living under a rock for quite some time, but it turns out iOS Shortcuts (and MacOS) are pretty awesome, once you identify a proper use case for them. For me, the use case was simplifying connecting to my home, or work lab, network, via VPN.

Now, I am pretty sure I have looked into how to do this years ago, without finding a solution, but in case someone else might benefit from it, here is a walkthrough of creating a simple VPN toggle button on your iOS homescreen, i.e no more diving into settings to connect.

1. Toggle VPN connection Shortcut Button or Widget #

For some reason iOS does not provide a native VPN widget, or a way of quickly toggling a VPN connection without navigating into settings. Luckily iOS Shortcuts provide a way of doing that, which works very well. I have tested this for both “native” L2TP VPN connections, and Wireguard connections.

How to configure a VPN Toggle button on iOS #

  1. Open the Shortcuts app and tap the “+” button in the upper-right corner.

  2. Tap the arrow besides “New Shortcut", and select Rename and put in whatever you want to call it. I used “Toggle VPN (vpn name)”.

    Create new iOS Shortcut

  3. Tap on “Add Action” and search for “Set VPN

    Find the Set VPN option

  4. By default the action for the Shortcut is “Connect”, which will connect to a VPN. In this case, I wanted a toggle switch to either connect or disconnect a VPN connection. Change this by tapping on “Connect” and change it to “Toggle”.

    Select VPN Connection

  5. Tap on VPN to select which connection you want to use.

    Select VPN Connection

  6. Tap the arrow besides your shortcut name again and select “Add to Home Screen”. This brings up a preview of the icon selected and name for the Shortcut. To add it to your home screen, tap on “Add” in the top right hand corner.

    Add Shortcut to Home Screen

This adds the new toggle shortcut to your home screen, and it should now work like this:

Select VPN Connection

A simple click to toggle the VPN connection. Nice!

Post last updated on January 2, 2024: Add author

About

vNinja.net is the digital home of Christian Mohn and Stine Elise Larsen.

The primary focus is on IT architecture and data center technologies like virtualization and related topics, but other content also pops up from time to time.

Sponsors