Subject: Picking a default route from multiple dhclient-managed interfaces
To: None <netbsd-users@netbsd.org>
From: Michael D. Spence <spence@panix.com>
List: netbsd-users
Date: 01/23/2006 10:06:15
I have two interfaces that connect to the Internet via separate
cable modems.  One has a VPN box in the way and the other 
doesn't.  Whenever my NetBSD system gets rebooted, dhclient 
configures the two interfaces.  However, I would like to always
use one of the interfaces as the default route and it is often 
the case that the other one ends up in this role.

It seems to me, from looking at dhclient-script, that this depends 
on which interface gets configured first.  I thought about using
the dhclient-script hooks to force the issue, but I'm not really
comfortable that this is the best way.

I also thought that adding some stuff to rc.local might work, but
the problem there, ISTM, is that dhclient might not be done yet if
the DHCP servers involved are being pokey.

I also considered adding an alias to dhclient.conf for each of these
interfaces, which could then invoke some alternative dhclient-script I 
could write to do what needed to be done, but it isn't exactly clear to
me that the real dhclient-script will run before or after mine (although
I'd think it'd be before, right?).  If it's after, this wouldn't really
be helpful.

Any advice on choosing between these alternatives?  Is there another
way that would be better?



Michael D. Spence
Mockingbird Data Systems, Inc.