Always-On, Without Thinking About It
With a VPN running at home, the next logical step was making sure it’s actually used consistently. Manually turning it on and off isn’t realistic—eventually you forget, and the whole point of having it is lost.
The solution was simple: automate it.
The Goal
The behavior I wanted was straightforward:
- When my iPhone disconnects from my home Wi-Fi → turn VPN on
- When it reconnects to home Wi-Fi → turn VPN off
Once configured, it runs entirely in the background.
What You Need
Before setting this up, make sure:
- Your VPN (in my case, the Orbi router VPN) is already configured on your iPhone
- You can manually connect/disconnect it from Settings
Creating the “VPN On” Automation
- Open the Shortcuts app
- Tap the “Automation” tab at the bottom
- Tap the “+” in the top right
- Select “Wi-Fi” as the trigger
- Choose “Is Disconnected” and your home Wi-Fi network
- Tap the checkmark (top right)
- Select "Run Immediately" in the automation drop-down
- Tap "Next" (top right)
- Tap “Create New Shortcut”
- In the action search field, type “VPN”
- Select “Set VPN”
- Set it to “Connect” and choose your VPN configuration
- Tap the blue check (top right)
- Tap “Done”
Creating the “VPN Off” Automation
Repeat the same process with three changes:
- Choose “Is Joined” and your home Wi-Fi network
- In the WiFi settings also toggle-on "Run After Connection Interruption".
- Set the VPN action to “Disconnect”
Why This Matters
This small automation removes all friction. The VPN is always active when it needs to be, and never in the way when it doesn’t.
It also ensures that traffic leaving your phone—especially on public or unknown networks—is always routed securely back through your home setup.
Works Seamlessly with the Pi Setup
This automation is part of a broader home setup I originally built around a Raspberry Pi–based home server. If you haven’t seen that setup yet, the idea is that the Pi acts as a central hub for services on my home network, including VPN access, media streaming, and local network utilities.
You can read the original Raspberry Pi home server setup: Pi system overview to understand the full context.
Because the VPN ties back into those Raspberry Pi services, this automation effectively extends your entire home network wherever you go.
Jellyfin, Samba access, Pi-hole filtering—it all becomes available automatically the moment you leave home.
Set It Once, Forget It
Like the rest of this system, the best part is that it disappears into the background. There’s no app to open, no toggle to remember—just consistent, automatic behavior.
It’s a small addition, but it ties everything together and makes the whole setup feel complete.