Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
IKEv2 security association continually re-established when using iOS 10, strongSwan 5.3.5 #430
Comments
evanchaney
commented
Apr 17, 2017
|
This issue has also been reported to Apple under Radar 31649808. |
|
Thanks for such a detailed finding! I was under the impression that Ubuntu 16.04 uses strongSwan 5.1.2 and that Ubuntu 17.04 upgraded to 5.5.1. I think this issue only affects Ubuntu 16.10? |
evanchaney
commented
Apr 17, 2017
evanchaney
commented
Apr 17, 2017
|
Also, it does appear that increasing the |
|
Ah yes, Ubuntu 16.04 uses 5.3.5 now.
It looks like we'll have to test the workaround of modifying the dpddelay. We may investigate changing the base install to Ubuntu 17.04 in the near future. |
dguido
added
the
client_apple
label
Apr 17, 2017
dguido
assigned
gunph1ld
Apr 17, 2017
added a commit
that referenced
this issue
Apr 17, 2017
|
The patch above keeps iphone connected in the sleep mode |
|
@evanchaney Is disabling dpd entirely a good solution for you? |
dguido
closed this
in
1778cb1
Apr 18, 2017
evanchaney
commented
Apr 19, 2017
That does mitigate some of the re-association churn, yes. However, disabling DPD checks may have other adverse effects. With the dead-peer-detection delay set above the child security association lifetime my everyday device has delivered longer battery life and IKE security association initializations are down. However, my phone continues to start new IKE SAs when it doesn’t seem like it should need to. In the first hour of starting a new Algo VPN instance it initiated about 1 new IKE SA per minute even though the server was not terminating the existing SA. As a result, the server issued 62 of its 255 virtual IPs in the first hour. (I also had 2 other devices associated.) Without performing dead-peer checks the server might run out of private IPs to assign to clients. The issue could be further complicated if the user uses the same VPN identity across multiple devices. It appears iOS 10 may send an INITIAL_CONTACT notification in each IKE_INIT_SA request indicating any previous IKE SAs from that identity should be closed. When using a laptop and a phone concurrently with the same identity each device’s session would continually be reset. I haven’t yet confirmed or isolated the cause of these new observations, but if they are bugs or behaviors of iOS’ IKEv2 client turning off DPD checks rather than just raising the interval could have adverse effects like IP depletion. I’ll continue trying to isolate and identify the behaviors I’m seeing. |
jplock
commented
Apr 20, 2017
|
Would it make sense to enable dead peer detection, but only on zesty?
I can submit a PR for this if we can do this. |
|
We don't support Zesty yet. In progress #449 |
dguido
reopened this
May 2, 2017
davidemyers
commented
May 2, 2017
|
Since this has been re-opened I'll add a few more observations on using strongSwan 5.5.1 with iOS 10. I spent some time trying many different permutations of Also, when a device is struggling to reconnect I see no logging output from |
evanchaney commentedApr 17, 2017
OS / Environment
Ansible version
Version of components from
requirements.txtSummary of the problem
strongSwan 5.3.5 when used with iOS 10 results in continual
re-establishment of the IKEv2 security association between the iOS
device and charon daemon. Re-association happens anywhere from
several times per minute to several times per hour.
When used on an everyday device with many services setup (email,
calendaring, background app refreshing) an apparent effect is
significantly decreased battery life on the iOS device (2x difference
observed between the IKEv2 VPN configuration and a non-IKEv2 VPN
configuration). No effect has been observed on the ability to retrieve
data over the VPN, however.
In one instance 51 re-associations were observed over 18 minutes.
Steps to reproduce the behavior
append=yesinstrongswan.conf, adjust AppArmor profile to allow access to
/var/log/charon.log, reload AppArmor profile and restart
strongswan).
new device (no restore from backup).
notifications and receives no response. After several retries the
IKEv2 server terminates the IKE security association requiring the
iOS device to re-establish it and the child SA. Observe the issue
repeats continuously.
The way of deployment (cloud or local)
Expected behavior
server. IKEv2 server retains the IKE SA between the server and
client.
Actual behavior
server re-attempts the DPD check 5 times then deletes the IKE SA
between iOS device and IKEv2 server.
Possible resolutions
It is not clear if the root cause lies in iOS or strongSwan:
https://wiki.strongswan.org/issues/2126
However, strongSwan states the issue is resolved in strongSwan 5.5.1.
Modifying Algo to install strongSwan from source rather than APT would
allow for installation of a specific (newer) version of strongSwan.
Alternatively, modifying Algo to allow the choice of Ubuntu image
used would make it possible for the installer to get a newer version of
the strongSwan package by using a non-LTS version of Ubuntu (17.04).
It may be possible to work around the issue by configuring the charon
keepalive/DPD rate to occur at a higher rate than iOS so iOS
is always the DPD initiator. This has not yet been explored.
charon.logs