![Android 设备无法连接到 MS L2TP PSK](https://linux22.com/image/605734/Android%20%E8%AE%BE%E5%A4%87%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%20MS%20L2TP%20PSK.png)
我已经使用 PSK 配置了 MS Server 2003 RRAS 和 IPSec/L2TP。iPhone 设备连接正常,但 Android 设备连接失败。MS“Oakley”跟踪文件显示,Apple 和 Android 的协商遵循类似的路径,直到隧道连接基本完成,然后我看到:
2-06: 17:15:24:788:c98 Sending: SA = 0x0014B770 to XXX.XXX.90.176:Type 4.4500
2-06: 17:15:24:788:c98 ISAKMP Header: (V1.0), len = 76
2-06: 17:15:24:788:c98 I-COOKIE 05ba0fca40358ea5
2-06: 17:15:24:788:c98 R-COOKIE 249f8fb9b53208ed
2-06: 17:15:24:788:c98 exchange: Oakley Quick Mode
2-06: 17:15:24:788:c98 flags: 3 ( encrypted commit )
2-06: 17:15:24:788:c98 next payload: HASH
2-06: 17:15:24:788:c98 message ID: f0a0f242
2-06: 17:15:24:788:c98 Ports S:9411 D:9411
2-06: 17:15:26:617:65c SocketError 10054
2-06: 17:15:28:679:65c SocketError 10054
2-06: 17:15:32:663:65c SocketError 10054
2-06: 17:15:40:663:65c SocketError 10054
2-06: 17:15:50:695:65c SocketError 10054
2-06: 17:16:47:929:c98 CE Dead. sa:0014B770 ce:000DF868 status:35f0
我在 JellyBean 和 Gingerbread 设备上尝试过此方法,结果相同
以下是来自 gingerbread 的 adb logcat:
I/racoon (11163): initiate new phase 2 negotiation: 192.168.2.27[4500]<=>XXX.XXX.125.226[4500]
I/racoon (11163): NAT detected -> UDP encapsulation (ENC_MODE 2->61444).
W/racoon (11163): ignore RESPONDER-LIFETIME notification.
W/racoon (11163): attribute has been modified.
I/racoon (11163): Adjusting my encmode UDP-Transport->Transport
I/racoon (11163): Adjusting peer's encmode UDP-Transport(61444)->Transport(2)
W/racoon (11163): ignore CONNECTED notification.
I/racoon (11163): IPsec-SA established: ESP/Transport XXX.XXX.125.226[0]->192.168.2.27[0] spi=197781845(0xbc9e955)
I/racoon (11163): IPsec-SA established: ESP/Transport 192.168.2.27[4500]->XXX.XXX.125.226[4500] spi=3463706620(0xce73f7fc)
D/mtpd (11485): Timeout -> Sending SCCRQ
D/mtpd (11485): Received SCCRP without valid challenge response
E/mtpd (11485): Protocol error
D/mtpd (11485): Sending STOPCCN
I/mtpd (11485): Mtpd is terminated (status = 5)
I/SProxy_mtpd(10676): got data from control socket: 5
E/VpnService(10676): onError()
E/VpnService(10676): com.android.server.vpn.VpnConnectingError: Connecting error: 5
E/VpnService(10676): at com.android.server.vpn.VpnService.onError(VpnService.java:171)
E/VpnService(10676): at com.android.server.vpn.VpnService.waitUntilConnectedOrTimedout(VpnService.java:198)
E/VpnService(10676): at com.android.server.vpn.VpnService.onConnect(VpnService.java:136)
E/VpnService(10676): at com.android.server.vpn.VpnServiceBinder$2.run(VpnServiceBinder.java:117)
E/VpnService(10676): at java.lang.Thread.run(Thread.java:1019)
I/VpnService(10676): disconnecting VPN...
D/VpnSettings( 8921): received connectivity: Mdc: connected? DISCONNECTING err=0
I/StatusBarManagerService( 123): ADD-Mdc VPN disconnected , 0x7f020001
I/SProxy_mtpd(10676): Stop VPN daemon: mtpd
D/SProxy_mtpd(10676): mtpd is stopped after 0 msec
D/SProxy_mtpd(10676): stopping mtpd, success? true
I/SProxy_racoon(10676): Stop VPN daemon: racoon
I/racoon (11163): Bye
D/SProxy_racoon(10676): racoon is stopped after 0 msec
D/SProxy_racoon(10676): stopping racoon, success? true
D/VpnService(10676): onFinalCleanUp()
I/VpnService(10676): restore original suffices --> null
D/dalvikvm( 196): GC_EXTERNAL_ALLOC freed 506K, 58% free 2991K/7047K, external3443K/3473K, paused 30ms
D/VpnSettings( 8921): received connectivity: Mdc: connected? IDLE err=5