I’m wrapping my head around the following:
If I’m home, I don’t need any VPN to my place, since I’m already in my own WI-FI. But I’d like to automatically activate the VPN once I leave the house and connect to cellular or any other Wi-Fi.
So far I set up a shortcut, which toggles the VPN + I made an automation, which turns the VPN off, once my phone connects to my WI-FI.
Do you have any idea / suggestions, how I can archive the Auto VPN connect without a configuration profile or MDM?
You can select which individual Wi-Fi connections will turn on the VPN in shortcuts. Or probably make a shortcut that grabs the Wi-Fi name, and if it matches it won’t turn on VPN but it will if it doesn’t match. This would be an automation.
I need something similar
I use teams for my work and I want to go on vacations
I want to use my express vpn so when I login into teams it shows that I still in the US
I want to only teams use my vpn, is it possible?
But this only works if my phone is connected to any Wi-Fi, right?
How do I automatically toggle on the VPN if I’m on cellular? Because from what I understand, it checks to which Wi-Fi the device is connected and either turns the VPN on or off. But it doesn’t do anything if I’m on cellular. Or is Apple including cellular in “Any network”?
I’m not familiar with express VPN and was only a “user” of it back in my old company.
But you could do a split tunnel VPN, which redirects your Teams traffic to the US while everything else doesn’t go through the VPN tunnel.
Unfortunately, I have no clue how to set it up and can’t help you with that. But it’s probably just a google search away
For me, I just use WireGuard and my raspberry works as the WireGuard server with “PiVPN”. But this is a full tunnel and redirects all the traffic to my home and raspberry pi.
But once you set up the split tunnel vpn it’ll be the normal setup on your iPhone. Download the app (if there is one), import the vpn profile, activate within the app or a custom shortcut and / or try creating an automation which auto connects to the vpn. But as I already said, I didn’t get the auto connect to work with just the phone service and no Wi-Fi. So a button it is for me.
It’s working now and didn’t had to use any shortcuts.
I had some trouble understanding the “otherwise” instead of “else”, but I figured it out. So it was just a brain dump…
Okay, so what the automation does:
Get Network Details
If(Wi-Fi Name is not MyWifi){
turn on VPN myVPN
}Else{
If(Wi-Fi doesn’t has any value <#aka cellular#>){
turn on VPN my VPN
}else{
If (WI-FI Name equals MyWifi){
turn off VPN MyVPN
}
}
}
And in case I don’t want to be connected to the VPN for some reason, I created a shortcut, which toggles it on or off.
Thanks for the help and helping me figuring this out!
Edit: sorry for the formatting. In this sun we either don’t have a code block or I can’t find it. Sorry for the inconvenience.
Does otherwise mean else, or did you find an “else” command? I’m new to shortcuts too. What is your automation trigger before running all the commands?
Sorry for the late reply. Turned off Reddit notifications and just saw it.
From what I can tell the “otherwise” is the “else”. My Trigger is “Wi-Fi → when MyPhone connect to AnyWifi”. Then I do some if-else(otherwise) to check if it’s my Wi-Fi or any other one. Unfortunately I had a bug in testing. When I tested, my iPhone connected to my iPad as hotspot instead of using mobile data… after I sorted that out, I noticed the trigger doesn’t work with mobile data… Means what I wrote in my earlier comment “Wi-Fi doesn’t has any value” doesn’t work. Unfortunately…
Anyway, to overcome this, I did the following:
I created a shortcut, which simply turns on / off the VPN and added it to my dock. Now when I leave the apartment and put on some music, I press the VPN button, which turns it on. Then I added a automation, which again uses the Wi-Fi trigger to turn the VPN off. This looks like: “When MyPhone connects to MyWi-Fi → turn off VPN”
It’s not fully automated but it’s the only solution that I figured out and really works so far. This also means that I have to manually connect to the VPN with a single button (which is better than opening the app and turn it on), I’m always connected to the Wi-Fi and it turns off, once I’m in range of my own Wi-Fi.
Here’s a pic of the automation for disconnecting the Wi-Fi. Will add 2 more comments for the “Do” part and the button