Automating the Default Route (?)

Damien Elmes clug at
Sat Nov 2 20:01:50 EST 2002

Jepri <jepri at> writes:

> Strangely I think the kernel does this. I'm not going to try it right now -
> I'm downloading a few things. But from memory, the first interface you bring
> up gets set as the default route.

Not as far as I know. Since the 2.1 kernels, a route was added by default to
the network interface you're configuring - pre 2.1, after an ifconfig, you had
to route add -net xxx

> I can see the logic - for every machine except a gateway machine, the default
> route should be set to your only network interface. Only machines on multiple
> networks have an issue.

It doesn't really make sense. Half the machines on networks out there aren't
connected to a wider network, and packets not known to be part of the local
topology should be discarded in this case with a "unknown network" error,
rather than being uselessly cast at a gateway that doesn't exist.

.. anyway - when you set up a network configuration, how would it determine
what the default gateway is? Guess? 

Damien Elmes

More information about the linux mailing list