Re: route reload after interface restart

From: Jose Luis Domingo Lopez
Date: Fri Jul 01 2005 - 03:26:32 EST


On Friday, 01 July 2005, at 12:41:08 +0800,
Benbenshi wrote:

> i have done an experiment as follow:
>
> 1. default route was add to eth0
> 2.ifconfig eth0 down
> 3.ifconfig eth0 192.168.10.57 netmask 255.255.255.0 up
>
> no default route was re-added to kernel, failed!
>
And how the kernel is supposed to know what your desired default gateway is?

When you bring a network interface down, it wipes every route using that
interface. If you then bring the interface up again, and give it an IP and
network mask, there will be no more added routing information but the
route to the network where the interface is directly connected.

What you need is not the way the kernel works. Think about, for example, a
dial-up network interface with frequent IP changes. Suddenly the link goes
down, it makes the call, and gets a differente IP/mask _and_ default route
to the Internet. If the kernel somewhat remembered the previous default
route, if wouldn't work.

So, to make the default route persistent, script the thing.

Greetings,

--
Jose Luis Domingo Lopez
Linux Registered User #189436 Debian Linux Sid (Linux 2.6.13-rc1)

Attachment: signature.asc
Description: Digital signature