Avoid creating PPTP default routes

Sep 09, '03 09:05:00AM

Contributed by: Anonymous

Saw this floating around, been using it for a month or so now, works a treat. This is really no good for people that use Internet Connect or any Internet Services that use PPPD, but hey, if you're Ethernet connected, it works fine.

Start by creatings a new pppd file:

 % su
 % cd /usr/sbin/
 % mv pppd pppd.orig
 % vi pppd
Put in the following text:
 #!/usr/bin/perl
 my @args = @ARGV;
 s/^defaultroute/nodefaultroute/ for @args;
 exec "/usr/sbin/pppd.orig", @args;
Save the file and quit, then make the new file executable with chmod +x pppd, and you're done. Now every session that is started with PPPD will not create a default route. This includes dialup, PPTP, and I would think pppoe for ADSL. Once up, it's just a matter of routing the networks you want over the network. I've configured my PPTP server to assign me the routes, it seems to work fine.

Enjoy!

Comments (35)


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