Subject: Re: should the default route get a new interface automatically?
To: NetBSD Networking Technical Discussion List <>
From: Alan Barrett <>
List: tech-net
Date: 07/28/2001 12:25:06
On Fri, 27 Jul 2001, Greg A. Woods wrote:
> In playing around with different cards in my server I've been very
> frustrated by (among other things) having to manually reset the
> default route so that it picks up the new interface (I keep
> putting the local network address on different cards, physically
> reconnecting as necessary, during these tests).
> Shouldn't the default route automatically pick up the new interface just
> like link-level (ARP) entries do?

If I understand correctly, you are doing something like this:

	# 1. configure an interface
	ifconfig eth0 inet netmask
	# 2. configure a default route
	route add default
	# 3. unconfigure the first interface
	ifconfig eth0 inet netmask delete
	# 4. configure a different interface
	ifconfig eth1 inet netmask delete

After step 2, the default route "knows" that it's through interface
eth0, even though you didn't tell it that.

After step 4, you would like the default route to be through interface
eth1, but it's still through eth0.

The NetBSD kernel doesn't do recursive route lookups (though that would
be a useful feature), so it's impossible to create a route in which the
interface is determined at packet forwarding time via recursive lookup;
the interface associated with a route is always determined at "route
add" time.

Since we don't have recursive route lookup, one could argue that the
ifconfig delete in step 3 should also have deleted the default route.

--apb (Alan Barrett)