I have my vpn preferences configured as below:
let newIPSec = NEVPNProtocolIPSec()
newIPSec.serverAddress = AppConfiguration.getVPNEndPoint()
newIPSec.authenticationMethod = NEVPNIKEAuthenticationMethod.sharedSecret
newIPSec.username = VPNCredentialsModel.instance.vpnUserName()
newIPSec.passwordReference = VPNCredentialsModel.instance.vpnPasswordReference() as Data?
newIPSec.sharedSecretReference = VPNCredentialsModel.instance.vpnPresharedKeyReference() as Data?
newIPSec.useExtendedAuthentication = true
self.manager.protocolConfiguration = newIPSec
let disconnectRule = NEOnDemandRuleDisconnect()
disconnectRule.probeURL = URL(string:VPNCredentialsModel.instance.vpnProbeURL()!)
self.manager.onDemandRules = [disconnectRule]
self.manager.isOnDemandEnabled = true
self.manager.isEnabled = true
The connection does go through but when the device goes to sleep or idle mode and when the VPN turns off. When the device initiates a connection to the internet, the expected behaviour is to kick in the VPN connection. But that doesn't seem to happen. I'm aware that VPN is broken in iOS 9 and I was hoping that fixed this issue in iOS 10. Does anyone else see this issue?