Accessing a VPN (PPTP) via the command line

Mar 13, '03 09:30:00AM

Contributed by: wfolta

My employer has a Microsoft VPN (PPTP) server and I finally got connected to it. The Internet Connection app allows you to access a VPN, but it has a couple of parameters that may cause problems, and it also might be useful to see the command line way to do it. I got the basic command line syntax by invoking Internet Connection, then looking at ps -axlww. Here's the command I use:


% sudo pppd serviceid 2 debug logfile /tmp/ppp.log plugin /System/\
Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp \
plugin PPTP.ppp remoteaddress WWW.XXX.YYY.ZZZ redialcount 1 redialtimer 5 \
idle 1800 mru 1500 mtu 1448 receive-all ipparam 192.168.0.1 novj 0:0 noipdefault \
ipcp-accept-local ipcp-accept-remote noauth refuse-pap refuse-chap-md5 \
user domain\\username mypass password hide-password noaskpassword \
forcedetach mppe-stateless mppe-128 looplocal

% sudo route add -net AAA.BBB.0.0 AAA.BBB.CCC.DDD
Where you replace 'domain', 'username', 'mypass', and the 'AAA.BBB.CCC.DDD', etc, IP addresses with the proper ones for your site.

What's the difference between this and Apple's version? First, I don't use 'usepeerdns' or 'defaultroute', which are more appropriate if the VPN connection will be your ONLY connection to the rest of the net. And I've extended the idle timeout to a half hour (instead of 10 minutes).

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030311232930261