October 01, 2004

Using VPN on OSX

I have just been playing around with trying to get a VPN connection working and here are my findings. To start with I had problems just trying to get the VPN connection to authenticate. I ended up find out that what was required was for my home network router to have RIP turned on to allow the network to connect correctly. Well that was the first hassle, the next was that now I was connected it would take down my normal Internet access whenever I connected the VPN. Doing some searching around the internet I found this thread on MacSlash talking about this very problem. The problem is that the default behavior is that when you set up the connection all the data will then be routed over this network connection, not correct if you are using a broadband Internet connection and do not want to go through the VPN connection. Therefore what you need to do is change the default data route. What I ended up using is this set of instructions.

Open a terminal window
cd /usr/sbin
sudo cp pppd pppd.orig

Then create a new file in that same directory called pppd with the following contents:

#!/usr/bin/perl
my @args = @ARGV;
s/^defaultroute/nodefaultroute/ for @args;
exec “/usr/sbin/pppd.orig”, @args;

Save that file and do a:
sudo chmod 755 pppd

Basically what this does is that whenever OS X calls PPPD (the VPN daemon for PPPTP), it'll force the “nodefaultroute” option to be appended to the call.

This MAY cause problems if you use PPP for dialup connections.

To switch back to the original method, just
sudo cp pppd.orig pppd

These instructions work well and I now have a working Internet connection and VPN connection. I hope this helps everyone out there who wants to do the same thing.

Links
MacSlash Article on VPN and Default Routing

Posted by Egon Kuster at October 1, 2004 12:16 AM
Comments
Thanks Egon... i need to set one up at home for a house mate. Should be handy info! Posted by: Brett at October 1, 2004 10:17 AM