Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Lion Server VPN, Can Connect Locally, Not Remotely

I have both Lion and Lion Server installed on my Core 2 Duo iMac, mainly because I want the VPN feature of Server.


I configured everything correctly for the VPN, and can connect to it with no problems from my iPhone and iPad when I am within my own LAN (the server and the iPhone/iPad are on the same IP range and subnet).


I also used the automatic config within the Server app to configure my AirPort Extreme N Base Station. Looking at the Port Mapping section of my ABS from within AirPort Utility, I do in fact see that VPN Service (L2TP) is configured with the following UDP ports: 500, 1701 and 4500. Those ports ARE pointing to the iMac that is running the VPN server. Firewall on that iMac is turned OFF.


However, I am unable to connect my iPhone to the VPN Server using my Public IP address. I have tried it from within my network (out of network to internet the back), from my Verizon MiFi or from my iPhone's 3G connection (well, in my area it is still Edge). The iPhone simply sits on "Connecting" for a few seconds, then an alert comes up stating "The L2TP-VPN server did not respond. Try reconnecting. If the problem..." yadada.


I AM, however, able to get Web Sharing to work via my Public IP address, as well as VNC.


I also cannot connect to the VPN via the Public IP with other devices like my iBook, PowerBook G4, Windows 7 PC, or iMac G5. They ALL CAN connect via the local network 10.1.x.x IP address.


Am I missing something here? I did all of the automatic configurations, and all of the ports appear to be properly open.

iMac, Mac OS X (10.7)

Posted on Jul 20, 2011 9:59 AM

Reply
70 replies

May 7, 2012 10:10 AM in response to Rob Shepard

at the airport this morning I was fiddling w/my iPad and decided to try VPN. After mucking w/passwords and secrets, it finally worked! I wonder if the VPN errors are too vague, and it was a password issue all along.


Anyway, I VNCed in to my Mac and tried the same thing, no success. Again, console on server shows no activity from the Mac, suggesting that problem is on the client end, but I have no idea where to look.

May 11, 2012 12:02 PM in response to ctrld

firewall is off on both server and client.


I tried sudo vpnaddkeyagentuser /LDAPv3/127.0.0.1

but then it asked me 3 times for:

Enter admin name for node /LDAPv3/127.0.0.1:

and Password:.


I had no idea what it is asking for. I tried assigning a name for the node "vpntest", I also tried entering my "admin name" which is "admin", I'm guessing I did it wrong.

May 11, 2012 1:54 PM in response to Dan Pouliot

Sorry, I didn't say it. Please use username 'diradmin' (Open Directory Admin), password can be the same as admin user.


If it will not help, try to run

sudo mkpassdb -dump

to get a list of the users credentials.

Find the line corresponding to the vpn user (may be vpn_user1).


Run

mkpassdb -setkeyagent 0x.....

where the 0x... bit is the big hex number to the immediate left of the username from the previous dump command.


Source: https://discussions.apple.com/thread/1229769?start=0&tstart=0

May 14, 2012 3:03 PM in response to ctrld

thanks ctrld. at least it didn't ask for the password 3 times, but still no vpn and still 0 lines added in server's console (I verified connecting from my iPad from home succeeds, and generates 30+ lines in console).


However, after running that terminal command, I found this in console, not sure if it is related to my issue:

opendirectoryd: GSSAPI Error: Miscellaneous failure (see text (Server (krbtgt/OMANSION.PRIVATE@MANSIONSERVER2.LOCAL) unknown while looking up 'ldap/server.omansion.private@OMANSION.PRIVATE' (cached result, timeout in 1200 sec))

May 28, 2012 7:22 AM in response to Dan Pouliot

I used Wireshark to do a packet capture of en0 (my wifi is off). I think I have discovered the problem, but I don't know the solution. The packet capture shows the following error about 30 times in a row each time i try to enable VPN:


Source: 10.0.1.4

Destination: 10.0.1.1

Protocol: ICMP

Info: Destination unreachable (port unreachable)


10.0.1.4 is my Mac and 10.0.1.1 is my AEBS. Why would attempting to initiate VPN cause this error?

Oct 31, 2012 6:43 AM in response to Rob Shepard

This is quite the old thread, but I wanted to share my results as it was quite a PITA in order to get my VPN up and running.


Attempting to use my Mini for more then a media browser, I installed server on it to use the VPN and other hosting items. Much like the other people in this thread with an AEBS, I could VPN on the same network (dumb) but not from a public IP address. I found that BTMM could mess up some of this up, so I removed that from the config, saved and restarted.


Nothing.


Still assuming it was related to BTMM, I exported my config, and wiped the device. I used Server to reconfigure the VPN settings again and it worked. Luckly the config that Apple exports is human readable, so I started looking through it. I found the following lines and deleted them.


key>DynS</key>

<dict>

<key>State:/Network/BackToMyMac</key>

<dict/>

<key>State:/Network/MulticastDNS</key>

<array>

<string>local</string>

<string>...</string>

<string>...</string>

<string>...a</string>

<string>...</string>

<string>...</string>

</array>

<key>State:/Network/PrivateDNS</key>

<array/>

</dict>


I reloaded my config and it worked with my settings. As someone who works with networking equipment regualrly, this is the problem with Apple's "It Just Works".

Lion Server VPN, Can Connect Locally, Not Remotely

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