vpnd rundown

I'm intentionally cross-posting this here. Original thread in the os x non-server version here: http://discussions.apple.com/thread.jspa?threadID=2046230

So, apparently the client version of os x has a VPN server (man vpnd in Terminal if you don't believe me), and the only thing missing is the graphical front end.

I'd rather not pay $~30 for iVPN ( http://www.macserve.org.uk/projects/ivpn/) just as a front end, though what I do know about the config came from reading source code for an old version (2.4b) that's still under a BSD license. I have no problem screwing around CLI, but I'd like to know what I'm doing before I start anything severe.

The service is obviously not running correctly. vpnd shows up in `ps ax` (initialized as `vpnd -i com.apple.ppp.l2tp`) and appears to be running. But, a port scan of the computer in question (from inside the LAN) shows no open ports relating to VPN. A rootkit hunter that also searches open/listen ports on the server confirms this analysis, which I think implies it's not a firewall issue.

Oddly enough, /etc/hostconfig says it (the file) is going away and doesn't appear to be correct (i.e, the value for afp server is --NO-- when I'm running one that starts at boot time).

I'm having issues figuring out exactly what is meant by some of the entries in the plist file for the server (/Library/Preferences/SystemConfiguration/com.apple.RemoteAccessServers.plist) as well as how to write this file from scratch.

So, my questions are as follows:

1) How do I get the vpn server working?

2) Could the lack of open ports imply a firewall issue?

3) Is the os x (non-server) install not working as a dhcp server, and could that be the issue?

4) Do I need to change my router settings to allow for more ip addresses in the range specified in RemoteAccessServers.plist?

5) What ports need to be forwarded to the vpn server in the router. I'm currently forwarding a list of ports (500, 50, 51, and 1702) that I found on the wiki pages for l2tp over IPsec and PPTP (before I decided which one to use).

6) Why does the plist file appear to store the username, password, and shared secret in plain text? Is this related to not using Open Directory? If so, is there an Open Directory server in the client version of OS X?

I can provide config files as needed (sanitized, of course; see question #6) as soon as someone shows up who can help.

The easy solution would be to buy OS X server, but that's not an option at the moment. I plan on doing it as soon as I can, but I'd like to play with more of what OS X has to offer on the server side before I spend $500 on it.

Macbook 2.16, Mac OS X (10.5.7), I also run Gentoo.

Posted on Jun 19, 2009 9:30 AM

Reply
14 replies

Jun 19, 2009 10:40 AM in response to djeru

It looks like the reason the user/pass/shared secret were stored in plain text was to get around having to use Open/Active Directory.

So, does OS X client do open/active directory or am I going to have to leave this login information plain text?

Also, I found a tip ( http://www.macosxhints.com/article.php?story=20060616150640529&query=vpnd) on using it in 10.4, but apparently the change from netinfo to open directory changed things.

Anyone know of something similar and/or how to set up open directory on 10.5 client?

Jul 11, 2009 11:58 AM in response to djeru

Check out this posting. http://forums.macosxhints.com/showthread.php?p=149892
I am currently running vpnd on mac os x 10.5.7 client. Some of the config files I had to create as they were missing in the OS. I confirmed that when I rebooted the Mini that the server started up correctly. I can now connect to my VPN Server using my iPhone 3.0 OS and Windows XP SP 3. If you need any help let me know. I did delete the CHAP authentication in the xml file and I unchecked the "store share secret in key chain" option in iVPN application. Here is the link to iVPN 2.4b When you launch the app it will ask if you want to download the latest version, say no. http://ftp.heanet.ie/disk1/sourceforge/i/iv/ivpnd/iVPN-2.4b.zip

Here is the website where it explains how to configure using this tool: http://tinyapps.org/docs/osx_vpnserver.html

Message was edited by: silverfun

Aug 28, 2009 1:41 PM in response to djeru

I seem to have this working, at least in part. I was able to even get my iPhone connected.

$ cat /Library/Preferences/SystemConfiguration/com.apple.RemoteAccessServers.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ActiveServers</key>
<array>
<string>com.apple.ppp.l2tp</string>
</array>
<key>Servers</key>
<dict>
<key>com.apple.ppp.l2tp</key>
<dict>
<key>DNS</key>
<dict>
<key>OfferedSearchDomains</key>
<array/>
<key>OfferedServerAddresses</key>
<array/>
</dict>
<key>IPv4</key>
<dict>
<key>ConfigMethod</key>
<string>Manual</string>
<key>DestAddressRanges</key>
<array>
<string>192.0.2.1</string>
<string>192.0.2.1</string>
</array>
<key>OfferedRouteAddresses</key>
<array/>
<key>OfferedRouteMasks</key>
<array/>
<key>OfferedRouteTypes</key>
<array/>
</dict>
<key>Interface</key>
<dict>
<key>SubType</key>
<string>L2TP</string>
<key>Type</key>
<string>PPP</string>
</dict>
<key>L2TP</key>
<dict>
<key>IPSecSharedSecret</key>
<string>PlaintextPassword</string>
<key>Transport</key>
<string>IPSec</string>
</dict>
<key>PPP</key>
<dict>
<key>AuthenticatorProtocol</key>
<array/>
<key>LCPEchoEnabled</key>
<integer>1</integer>
<key>LCPEchoFailure</key>
<integer>5</integer>
<key>LCPEchoInterval</key>
<integer>60</integer>
<key>Logfile</key>
<string>/var/log/ppp/vpnd.log</string>
<key>VerboseLogging</key>
<integer>1</integer>
</dict>
<key>Server</key>
<dict>
<key>Logfile</key>
<string>/var/log/ppp/vpnd.log</string>
<key>MaximumSessions</key>
<integer>128</integer>
<key>VerboseLogging</key>
<integer>1</integer>
</dict>
</dict>
</dict>
</dict>
</plist>


Of note:

1. This must always be a range of IP addresses, even if you only want your server to listen on a single IP address. I’ve not looked too deeply into it, but when I specify only one address, vpnd will not start and log that a range was not specified.

<key>DestAddressRanges</key>
<array>
<string>192.0.2.1</string>
<string>192.0.2.1</string>
</array>

2. Set this to the Shared Secret that you will configure in your Network Preference Pane on the client machine.

<key>IPSecSharedSecret</key>
<string>PlaintextPassword</string>

3. I’m sure there are other values for this, but for now I leave it as “1”. Setting it to “0” will probably turn off verbose logging, which I might do once I’m certain it’s working exactly how I want it to.

<key>VerboseLogging</key>
<integer>1</integer>

4. I leave this section in its original place for completeness, but it seems that it can be safely removed; perhaps its absence imparts a default.

<key>AuthenticatorProtocol</key>
<array/>

Other settings are, for example:

<key>AuthenticatorProtocol</key>
<array>
<string>MSCHAP</string>
</array>


The only aspect of this I have not yet configured properly is having vpnd’s launchd property list configured to have it always on.

Sep 4, 2009 9:11 PM in response to seanscian

And, an update:

1. This must always be a range of IP addresses, because the key “DestAddressRanges” is not too intuitive. It’s not the destination address or “listener”, if you will, of vpnd, but the actual range of IP addresses provided by vpnd to a connecting client computer. So, specify only one address, vpnd will not start and log that a range was not specified.

<key>DestAddressRanges</key>
<array>
<string>192.0.2.1</string>
<string>192.0.2.1</string>
</array>

Nov 8, 2009 3:40 PM in response to seanscian

I setup VPND on Snow Leopard client with the help of these postings, and everything seemed to be working great until later I tried to connect and the connection began failing with this message:

2009-11-08 15:02:08 MST Incoming call... Address given to client = 10.0.2.109
Sun Nov 8 15:02:08 2009 : SCDynamicStoreCreate failed: Configuration daemon not (no longer) available
2009-11-08 15:02:08 MST --> Client with address = 10.0.2.109 has hungup

This persisted until restarting. My Mini had fallen asleep in-between, maybe that had something to with the error?

But what I am really asking about is setting it up to launch on boot and to be able to wake up a sleeping mini, (which works with the other services I have running).

I am assuming that I need to create a launchd plist for this, but have never done this before. Help would be appreciated.

One of my concerns is the switches to pass vpn when using launchd to daemonize correctly. So far I have been using it without any switches and it seems to load the proper configuration and daemonize, but according to the launchd docs, the process is NOT supposed to daemonize.

Thanks,
B

Nov 9, 2009 2:07 PM in response to Blair Lipkind

Out of interest:

I found in a different forum that if you have this problem:
2009-11-08 15:02:08 MST Incoming call... Address given to client = 10.0.2.109
Sun Nov 8 15:02:08 2009 : SCDynamicStoreCreate failed: Configuration daemon not (no longer) available
2009-11-08 15:02:08 MST --> Client with address = 10.0.2.109 has hungup

You can solve it by creating a startup item for VPND and rebooting.

I couldn't figure out how to do Launchd, so I ended up making a basic StartupItem for vpnd

Seems to be working for me so far.

I may have solved the other issue, depending on how my Mini and Airport Extreme behave regarding IP addresses... I use the free WakeOnLan utility to send a magic wakeup packet to my external address on one of the forwarded UDP ports for VPN. I think it works, but I've only tried it once.

Nov 24, 2009 5:05 PM in response to Douggo

Thanks for the info. I did not want all those ports open either 🙂 I had only opened them on an experimental basis.

That list of ports does seem to be working, but for some reason, the VPN keeps dropping my iPhone, at least when used thru the internet and not WiFi. Anyone had that happen?

Also, my computer's ability to serve webpages seems to stop when vpnd is running. Is there any easy way of getting around this?

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.

vpnd rundown

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