I connect to a bunch of WiFi hot spots with my iPhone, and love that I have a VPN option.

One thing I don't love is that it disconnects from the VPN if the screen ever goes blank.

How can I keep the VPN connected so I don't have random emails or other data in the open for man-in-the-middle attacks?

  • 1
    The way IOS works, I don't think you can do this unless you disable the standby/auto lock timer. – wilhil Aug 18 '11 at 12:50

According to this thread this is standard for most users. But there is Jailbreak solution with external app called Insomnia

Insomnia is an iPhone native application that, when enabled, will prevent the iPhone from sleeping, thus overriding its default behavior. This allows background applications to continue to run and WiFi to work long after the screen has been switched off.

(The iPhone's default behavior is to sleep 30 seconds after the screen has gone off, when not docked and charging that is).

Downside of this is your cpu etc is still running so battery will go down quickly.

There is also a tweak for Cisco VPN with SBSetting with Jailbreak that might work for non-Cisco software (as in the built-in VPN) but as I haven't tested it it's hard to say :-) It may be that the blog mentions the built-in VPN but I can't verify it myself. It's not clear whether it mentions Cisco app or the built-in VPN (and just names it Cisco VPN).

| improve this answer | |
  • 1
    :( ok. I don't wanna jailbreak though, so I'm guessing no actual solution – Canadian Luke Aug 18 '11 at 19:57
  • Here is a code snippet to stop the idle timer. '[application setIdleTimerDisabled:YES];'. Try if it works. – Durai Amuthan.H Nov 5 '13 at 7:00
  • Tweak has since not been updated, and does not function. – ian5v Jan 10 '15 at 7:51

"VPN-on-Demand" only works with one VPN protocol - IKEv2.

"VPN-on-Demand" is the only option to keep VPN "always on" for iOS.

Your VPN providers should offer IKEv2, and if they offer something else like OpenVPN - you won't get this "always on" option.

Also, IKEv2 is the only protocol that seamlessly continues to work when you switch from cellular network to wi-fi. Other VPN protocols will drop the VPN connection or endlessly will try to reconnect to the old network leaving you without internet.

| improve this answer | |
  • can you suggest any opensource VPN servers which supports IKEv2 protocol? – Arun Xavier Jun 20 '17 at 10:21

One workaround: on a jailbroken device, use Activator to link "Lock Device" or "Unlock Device" to "Toggle VPN". Everytime I unlock it, it reconnects to my VPN :) so now I am happy

| improve this answer | |
  • This actually works pretty well. – ian5v Jan 9 '15 at 4:33
  • 1
    But will it stay connected while the screen is off? – Canadian Luke Jan 9 '15 at 15:16
  • 1
    @CanadianLuke Nope. It's a bummer. – ian5v Jan 10 '15 at 7:51

I have just signed up for VPN service this week and i have been having the same problem. I use it to go on Netflix and Pandora from out of the country. I have been playing around to see if i can get the VPN to stay connected. So far, I found a solution that has been working for about an hour or so now.

I have a jailbroken iPhone 4 and i have installed Backgrounder from the Cydia store, which keeps programs running even when closed or when the screen is off.

After installing this, I installed Pandora from the App Store and after launching it, I held down the Home button to background it.

So far, it seems to be working because Pandora uses my connection and if i keep it in the background, it will prevent the VPN from disconnecting.

I have only been using it for a couple of hours, so I'm not sure how good of a permanent solution it will be.

| improve this answer | |
  • It would be great if you followed up with an edit to tell us whether this works well or not. – Dan Jul 26 '13 at 20:54

You need to use "supervised mode" on iphone to get permanent VPN. Very unpleasent as requires MAC to back up your iphone (setup will clear it completely). Look for "supervised mode" in Apple help pages. Basically it is like a corporate model where you control some settings from your computer.

| improve this answer | |
  • 1
    This answer would be much more helpful if you add the necessary details (and links) into your post so that people don't need to repeat the search you already did. – nohillside Jan 25 '19 at 7:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .