Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

VPN disconnects when iPhone goes into auto-lock ?

As the subject says....my iPhone seems to disconnect the VPN as soon as it goes into auto-lock....in my case after two minutes.
I have a L2TP VPN configured for a mail connection to an Exchange server...if it constantly disconnects then the pushmail functionality is of no use....

Is this behaviour as designed or am I missing something ?

Regards, Robert

PC, Windows 7

Posted on Feb 12, 2010 5:40 AM

Reply
Question marked as Best reply

Posted on Aug 17, 2010 5:58 AM

this isn't normal.

i'm using VPN for a year now. never noticed this...
i've tried now to replicate this and failed. it works fine!

i've only noticed it to be disconnected when fluctuation between 3G and EDGE happens. between WiFi and 3G the connection is persistent. push mail and other services work fine...

lock screen with 3G: http://img265.imageshack.us/img265/7105/photo2k.png
lock screen with WiFi: http://img411.imageshack.us/img411/2189/photo1ll.png
127 replies

Aug 30, 2011 8:16 AM in response to KJCarey

Ok, Jail Breaking the phone is not the answer. The problem is the iPhone and how the VPN tunnel works -- the iPhone shuts down its transmitter when in auto-lock to save battery probably. When this happens the VPN tunnel can no longer send keep-alive messages to the concentrator so the tunnel drops.


The answer is for Cisco to modify the VPN client so that it is not required to send keep-alives, but allow incoming messages from the network. I'm no security expert, so this could violate all kinds of best practice recommendations and security policies.


Our solution was to install Good for Enterprise which is an email proxy solution with a server on prem. It uses a special email client that continuously listens even when in auto-lock. It is able to provide alerts to the client about email and calendar events. When you wake up the phone it does a quick sync and runs normal, all emails are available. This works with Exchange and Lotus Notes backend. The Good for Enterprise does NOT require a VPN, it does its own security certificate exchange and encryption.

Nov 15, 2011 3:01 PM in response to robertvg

The answer is to use Cisco AnyConnect VPN with PKI certificates. We are testing this and it works pretty well. It is possible to set the VPN to be persistant and it only reauthenticates when it wakes up, it does this very quickly and using PKI certs it does not require any manual intervention. The tunnel restablishes very quickly.


Requires Cisco ASA on the host side at your data center, requires some method of securely distributing the digital certificates and a certificate authority, either your own or subscribe to Verisign or equivalent. It is not a simple proposition to implement, you need to be committed and have some resources to get it done.

Nov 15, 2011 3:13 PM in response to seechrisgo

What about the inherent Push problem regarding data transfers while the phone is locked or asleep -- will your Cisco AnyConnect still keep that data through its (disconnected) tunnel safe? I think this is half of the issue. Not only do you have to turn it back on when waking (no matter how fast) but it is still insecure while sleeping. No VPN will help that unless it remains intact even while locked and sleeping.

Jan 17, 2012 12:36 PM in response to robertvg

I've found that the VPN connection does not drop during sleep as long as the iPhone (4s, iOS 5.0.1) is kept plugged in. So here is one possible solution:


Buy a charging holster for your 3G or 3GS (Amazon), or one of the multitude of charging cases for your 4 or 4S --your VPN connection should stay alive, and your battery gets some needed reinforcement for the increased power drain that will occur.


This should work, at least until the external battery pack runs out of juice.

Jan 19, 2012 9:49 AM in response to jz1492

I read somewhere, I dont recall if it was in this thread or not, that this problem doesn't exist if you connect a VPN using Cisco AnyConnect app. I installed the app, and couldn't setup the VPN for my purposes because, as I expected, you need to use ot with Cisco VPN equipment/router. HOWEVER... The first time I launched the app, it said something like "AnyConnect will make changes to the way VPNs work on your device. Is this OK?" and I clicked yes/ok/proceed, whatever the button said. Ever since this time, my VPN has not disconnected when going to sleep. I don't even have the app anymore, I removed it when I realized it wouldn't work for me.


If you are able to establish a Cisco VPN, then it will also auto-reconnect when you go from wi-fi to 3g, loose and regain a connection, etc. It is designed to keep you constantly connected to the corporate network. However, it appears part of what it does is change the VPN functions of iOS sothe VPN does not drop after 30 seconds of being in sleep mode. I have gone 6 hours with the VPN remaining connected through 30 min to an hour of sleep at a time.


I hope this helps others out there. Just install Cisco AnyConnect, run it, accept/allow the changes, and reply to this post to let others know it it resoved the problem for you too. Once you have got it working, you can uninstall AnyConnect and it will still work.


**I dont know if there is a way to undo this, so once it changes the VPN to persistent you cant go back to the sleep-and-disconnect way, but why would you want to?

Jan 24, 2012 9:15 PM in response to KeithCFL

@KeithCFL: The AnyConnect app didn't work for me.


However, the iphone DOES have a built-in funcion to "auto-connect on demand" to a VPN. (I guess this is what the Anyconnect App does in essence)


The setting can't be made through the iPhone directly (why on earth not?!). You need to install Apple's iPhone Configuration Utility: http://support.apple.com/kb/DL1465


However it ONLY works with a Cisco IPSec tunnel using certificates.


So there it is, built-in to the iOS, but only works with one particular protocol and isn't accessible to the average user....

Feb 14, 2012 6:46 AM in response to VRADesign

I dropped my iPad (shattered screen), and had to replace it with a refurbished model. I can't get the VPN to stay conmected any more on y new iPad, even with the AnyConnect app. I guess I just got lucky last time, the VPN would only disconnect when I left WiFi. This really *****. I've tried everything I did last time, to no avail. I miss the persistent VPN connection-- I know it's possible because it worked on my last iPad2. It didn't create any significant battery drain either-- then again, I was on an iPad which has a bigger battery than iPhone, so the drain wouldn't be quite as noticable.


If I get it working again I'll be sure to update this thread.

VPN disconnects when iPhone goes into auto-lock ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.