由于IKEv2具备Mobike的功能,iOS也继承了这一点,但是它做的真尼玛蛋疼。具体表现为(以下的前提是你设置了Ondemand或者Alwayson的rule):
1, 假设你现在连接3G,wifi没有打开,当你访问任何网站的时候,VPN会自动连接。然后你打开WIFI,按理说此刻网络流量应该全部走WIFI了,VPN应该自动断开并且自动重连接,但iOS蛋疼的是,它不断开!!! 接下来你的所有流量都经由3G的VPN,与WIFI半毛钱关系也没有!!!
2,假设你在现在连着WIFI,并且VPN是关闭状态(比如你手动关闭了),此时上任何网站,VPN都会自动重连,然后再关闭WIFI,此时VPN断开了,但是它却是『正在连接』状态,它在等待你的WIFI重新联网,此时此刻,你的3G网络形同虚设,根本没用,任何网站都打不开。。。除非你再打开WIFI,它就会自动现实已连接。
总结一下就是,IKEv2在iOS上,它会坚持等待它拨号的时候通过的那个网络,如果那个网络关闭了,那么,他会一直等待,然后让其他网络根本无法用,其实iOS上就2个网络,WIFI和Cellular。这与IKEv2的mobike功能相悖。。。也就是说iOS上的IKEv2不能在WIFI和Cellular之间漫游!!!
以上测试在iOS 8.1 beta 2上完成,服务器用的Debian+Strongswan 5.2.0,为此我也咨询了12vpn这个服务商,他们的回复跟我遇到的情况一模一样:
Unfortunately this is standard behaviour for iOS and OS/X. Existing connections will stay on the old network if the old network is still available.
You've found that VPN will use cellular if WiFi is switched on after the VPN connected. The same is true for other connections: if you connect something else first, then connect the VPN, the old connection will not use the VPN.
I agree that it would be better if the VPN can reconnect automatically when you change networks. In fact, IKEv2 can technically do this, but it's up to Apple to enable it.
1, 假设你现在连接3G,wifi没有打开,当你访问任何网站的时候,VPN会自动连接。然后你打开WIFI,按理说此刻网络流量应该全部走WIFI了,VPN应该自动断开并且自动重连接,但iOS蛋疼的是,它不断开!!! 接下来你的所有流量都经由3G的VPN,与WIFI半毛钱关系也没有!!!
2,假设你在现在连着WIFI,并且VPN是关闭状态(比如你手动关闭了),此时上任何网站,VPN都会自动重连,然后再关闭WIFI,此时VPN断开了,但是它却是『正在连接』状态,它在等待你的WIFI重新联网,此时此刻,你的3G网络形同虚设,根本没用,任何网站都打不开。。。除非你再打开WIFI,它就会自动现实已连接。
总结一下就是,IKEv2在iOS上,它会坚持等待它拨号的时候通过的那个网络,如果那个网络关闭了,那么,他会一直等待,然后让其他网络根本无法用,其实iOS上就2个网络,WIFI和Cellular。这与IKEv2的mobike功能相悖。。。也就是说iOS上的IKEv2不能在WIFI和Cellular之间漫游!!!
以上测试在iOS 8.1 beta 2上完成,服务器用的Debian+Strongswan 5.2.0,为此我也咨询了12vpn这个服务商,他们的回复跟我遇到的情况一模一样:
Unfortunately this is standard behaviour for iOS and OS/X. Existing connections will stay on the old network if the old network is still available.
You've found that VPN will use cellular if WiFi is switched on after the VPN connected. The same is true for other connections: if you connect something else first, then connect the VPN, the old connection will not use the VPN.
I agree that it would be better if the VPN can reconnect automatically when you change networks. In fact, IKEv2 can technically do this, but it's up to Apple to enable it.