You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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 Top-ranking 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

Feb 21, 2011 8:58 AM in response to robertvg

Same problem here, L2TP with a Check Point firewall. Although there are other uses for the VPN in our organisation, the only use on an iPhone is to secure emails.

I'm not so much concerned that the VPN drops, but that it does not re-establish as needed - that's just plain annoying. I understand VPN-on-demand is possible in certain situations, but not with L2TP, and not with the shared-secret configuration supported by our firewall.

We need an additional parameter under e-mail account settings 'use VPN' so that when the email is refreshed the VPN is connected first.

Seems a simple enough request?

Apr 20, 2011 8:07 AM in response to robertvg

+1 I would like to see this addressed. Using public wifi is not a viable option for business users w/o this feature working reliably. I see the security issue on an admin standpoint to have a device automatically hooking to your private network as soon as it comes out of "sleep" but that can be handled on the VPN server side. It should not be imposed by the device. This is a bug IMHO.

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?

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.

Feb 26, 2012 9:37 PM in response to robertvg

It seems to save the battery getting drained out the vpn connection is getting auto terminated. People have suggested to turn off the auto lock feature. Though that solves the problem, but is a double security threat.


Another work around for the problem is to keep the phone on charge. For me the VPN does not get disconnected even after auto lock when the phone is on charge.

Apr 26, 2012 11:02 AM in response to robertvg

Hi people! I hope you are fine.


This problem was concerning me a long time ago. The infraestructure to establish the VPN connection is the following: Ipad2, dsl connection, IPSEC between ipad and Fortigate 60c. The only way i have to avoid disconnection when the ipad sleep was set "Automatic Block: Never". I try with Cisco anyconnect but i cant because my VPN does not use cert., only user, group and PSK. Jailbreak... Nah... the solution was Update the ipad to the version 5.1 (9B176).

After the upgrade, i set the VPN again and set the auto lock to 2 minutes. Then, when i go Unlock with the button the vpn still connected (or reconnected, do not investigate a lot)!!!



I hope this comment can help more than one!



Regards, Diego (Uruguay)

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 Account.