public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* route reload after interface restart
@ 2005-06-30 11:13 chengq
       [not found] ` <200506301418.04419.vda@ilport.com.ua>
  0 siblings, 1 reply; 6+ messages in thread
From: chengq @ 2005-06-30 11:13 UTC (permalink / raw)
  To: linux-kernel

hi

Routes relate to ethX were deleted from kernel after i shutdown ethX
(ifconfig ethX down),but after i start ethX (ifconfig ethX
XXX.XXX.XXX.XXX up ),  deleted  routes were not re-add to kernel .

Is there any patch or daemon can do this  for me, after i restart
ethX,deleted rotues were re-added to kernel automatically.

regards

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: route reload after interface restart
       [not found] ` <200506301418.04419.vda@ilport.com.ua>
@ 2005-06-30 14:11   ` chengq
  2005-07-01  0:47     ` Patrick McHardy
  0 siblings, 1 reply; 6+ messages in thread
From: chengq @ 2005-06-30 14:11 UTC (permalink / raw)
  To: Denis Vlasenko; +Cc: linux-kernel

On 6/30/05, Denis Vlasenko <vda@ilport.com.ua> wrote:
> On Thursday 30 June 2005 14:13, chengq wrote:
> > hi
> >
> > Routes relate to ethX were deleted from kernel after i shutdown ethX
> > (ifconfig ethX down),but after i start ethX (ifconfig ethX
> > XXX.XXX.XXX.XXX up ),  deleted  routes were not re-add to kernel .
> >
> > Is there any patch or daemon can do this  for me, after i restart
> > ethX,deleted rotues were re-added to kernel automatically.
> 
> This is offtopic for lkml.
> 
> Make a script which configure iface and add routes.
> --
> vda
> 
> 

script is not a good choice when you have several uncertain virtual
interfaces and some other administrators need to add route
,enable/disable interfaces freely~~

after that ,i have no shell in my embedded system ~~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: route reload after interface restart
  2005-06-30 14:11   ` chengq
@ 2005-07-01  0:47     ` Patrick McHardy
  2005-07-01  0:57       ` Benbenshi
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick McHardy @ 2005-07-01  0:47 UTC (permalink / raw)
  To: chengq; +Cc: Denis Vlasenko, linux-kernel

chengq wrote:
>>>Routes relate to ethX were deleted from kernel after i shutdown ethX
>>>(ifconfig ethX down),but after i start ethX (ifconfig ethX
>>>XXX.XXX.XXX.XXX up ),  deleted  routes were not re-add to kernel .

If you specify a netmask for the device a route will be added.

Regards
Patrick


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: route reload after interface restart
  2005-07-01  0:47     ` Patrick McHardy
@ 2005-07-01  0:57       ` Benbenshi
       [not found]         ` <42C498ED.4050400@trash.net>
  0 siblings, 1 reply; 6+ messages in thread
From: Benbenshi @ 2005-07-01  0:57 UTC (permalink / raw)
  To: Patrick McHardy, linux-kernel

Patrick McHardy wrote:

>chengq wrote:
>  
>
>>>>Routes relate to ethX were deleted from kernel after i shutdown ethX
>>>>(ifconfig ethX down),but after i start ethX (ifconfig ethX
>>>>XXX.XXX.XXX.XXX up ),  deleted  routes were not re-add to kernel .
>>>>        
>>>>
>
>If you specify a netmask for the device a route will be added.
>
>Regards
>Patrick
>
>
>  
>
sorry ,i cannot follow you.
you mean i have to specify the netmask when i startup the device ?
can you tell more details ?

regards,

Axin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: route reload after interface restart
       [not found]         ` <42C498ED.4050400@trash.net>
@ 2005-07-01  4:41           ` Benbenshi
  2005-07-01  8:24             ` Jose Luis Domingo Lopez
  0 siblings, 1 reply; 6+ messages in thread
From: Benbenshi @ 2005-07-01  4:41 UTC (permalink / raw)
  To: Patrick McHardy, linux-kernel

Patrick McHardy wrote:

>Benbenshi wrote:
>  
>
>>you mean i have to specify the netmask when i startup the device ?
>>    
>>
>
>Yes.
>
>  
>
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!

>>can you tell more details ?
>>    
>>
>
>Just try yourself.
>
>  
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: route reload after interface restart
  2005-07-01  4:41           ` Benbenshi
@ 2005-07-01  8:24             ` Jose Luis Domingo Lopez
  0 siblings, 0 replies; 6+ messages in thread
From: Jose Luis Domingo Lopez @ 2005-07-01  8:24 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-01  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-30 11:13 route reload after interface restart chengq
     [not found] ` <200506301418.04419.vda@ilport.com.ua>
2005-06-30 14:11   ` chengq
2005-07-01  0:47     ` Patrick McHardy
2005-07-01  0:57       ` Benbenshi
     [not found]         ` <42C498ED.4050400@trash.net>
2005-07-01  4:41           ` Benbenshi
2005-07-01  8:24             ` Jose Luis Domingo Lopez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox