How can Android device connect to OS X Server VPN (L2TP/IPSec)

I have installed OS X Server 4.1 (on Mac OS X 10.10.3 Yosemite) and have set up a VPN Server using L2TP/IPSec. I have been able to connect to it using any iOS device or Windows device (for Windows device I have had to make some custom changes). However, I have never been able to connect to it using any Android device. I have entered the IPSec Pre-shared key, username and password, but when my Android device tries to connect to it, it merely shows "connecting" for around 30 seconds and then disconnects.


Would anyone have any fix to the above problem?


Million thanks!!

iMac, OS X Yosemite (10.10.3), OS X Server 4.1

Posted on Apr 19, 2015 6:25 AM

Reply
14 replies

Jun 27, 2017 4:05 PM in response to zeefung

I have the same problem. Running Mac OS X El Capitan (10.11.6) Server. Can connect to VPN without any problem from MacBook and iPad but won't work from Android.

I noticed that the L2TP/IPSec options are different on Android VPN client than on the Mac VPN Server, ie. Android has fields for "L2TP secret" and "IPSec pre-shared key", whereas Mac VPN Server only has "Shared Secret". You cannot save the connection on Android unless you put the shared secret in the "IPSec pre-shared key" field but I wonder if this is really correct?

Apr 19, 2015 8:07 AM in response to zeefung

Check the ppp log of your server to see when the connection fails.

You can post that section of the log here.

Also check your shared secret, does it contain a " in it? That might cause the failure.

Create a new shared secret with only letters and numbers (upper and lowercase) and then test again.

The connection should work fine. Is port forwarding setup correctly?

You need forward UDP 500, 1701 and 4500 for all L2TP connections.

Goodluck


Jeffrey

May 17, 2015 4:07 AM in response to zeefung

Did you ever get this working zeefung? I seem to be having the exact same issue and it's driving me crazy! I have a L2TP/IPSec VPN server configured on my iMac (OS X Mavericks), and it work's brilliantly with iOS devices and windows (after some config with registry).


BUT, The built-in Android VPN client will not connect, and so far neither will any of the 3rd party applications I've tried. However, it connects perfectly when I am connected over wireless on the local network.


Could the fact that it can't seem to resolve the address externally be to do with the way NAT-T is taking place? As I say, all other devices work fantastically so all my port forwarding has been done correctly? I'd really like to get this sorted! Any help would really be appreciated.

Jun 14, 2015 12:31 AM in response to zeefung

Hi, sorry for my late reply. I still haven't been able to make my Android device connect to my Mac OS X Server VPN. I have now analyzed my Mac OS X Server log and I now can find that the difference between a "successful VPN connection" versus an "unsuccessful VPN connection" is that there are the following log lines in the unsuccessful connection - which won't exist for a successful connection:


Jun 14 15:14:27 server.******.com racoon[326]: Fatal INVALID-PAYLOAD-TYPE notify messsage, Phase 1 should be deleted.

Jun 14 15:14:27 server.******.com racoon[326]: Fatal INVALID-HASH-INFORMATION notify messsage, Phase 1 should be deleted.

Jun 14 15:15:00 server.******.com racoon[326]: 14.0.209.*** [my Android mobile's IP address] give up to get IPsec-SA due to time up to wait.


Does anyone have any idea what causes the above errors?


Thanks,


Philip

Dec 8, 2016 10:42 AM in response to Buddens93

Did you ever figure this out? I am experiencing the same issue now. Can connect internally but not externally with Android but every other device works.


In my log on the server it takes a longer with the Android device to make contact with the server (anecdotally - the first log lines don't show up for 20 seconds or so) and then the log shows that the device "hung-up". So it doesn't seem that the server is refusing the connection.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can Android device connect to OS X Server VPN (L2TP/IPSec)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.