Subject: dhclient and selecting a default route amongst several interfaces
To: None <netbsd-users@netbsd.org>
From: Brian de Alwis <bsd@cs.ubc.ca>
List: netbsd-users
Date: 08/16/2006 10:16:47
[I was hoping somebody here might have a pre-worked out solution.
I've tried doing a tiny bit of reading of routed's man page, but
it required a bit more knowledge than I can give time to right now.
I have also tried scrounging through the mailing lists, but didn't
find anything quite right.  (And `/etc/rc.d/routed forcestart' and
playing didn't seem to DTRT :-)]

I have a laptop with two network interfaces: wm0 for a wired
ethernet, and ath0 for wireless, and as I move between locations
a bit, I have dhclient set to listen on both interfaces.

At school I have two ways to connect to the net, through wireless
or a wired connection.  I generally prefer using the wired ethernet
as it's faster and more reliable.  But with dhclient also listening
to wireless, this means the interface chosen for the default route
depends on chance, and I'd like to fix this.

Although I could just hack some code into dhclient-exit-hooks to
forcibly decide the issue, I was wondering if I could use something
a bit more dynamic.  The wired network does hiccup very occasionally,
and it would be cool to have some kind of seamless switching.  Is
routed the right solution for this?

(I'm not worried about load balancing; I never saturate these pipes.
My interest in this is for synchronizing my laptop contents with
unison, and transferring podcasts -- the 1MB/s I often get from
the wired network is much better than than the wireless' 200k/s!)

Brian.

-- 
  Brian de Alwis | Software Practices Lab | UBC | http://www.cs.ubc.ca/~bsd/
      "Amusement to an observing mind is study." - Benjamin Disraeli