Skip to contentSkip to conversation

route reload after interface restart

DISCUSSION chengq 3 participants 6 messages Jun 30, 2005 – Jul 1, 2005 2 messages not in the archive

lore
Share & tools
lore

chengq

author
#0 lore raw

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw
Quoted 7 lines · Denis Vlasenko
Quoted 6 lines · chengq

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 .

Quoted 10 lines
Quoted 2 lines

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 ~~

#3 lore raw
Quoted 3 lines · chengq
Quoted 3 lines
Quoted 3 lines

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

author
#4 lore raw
Quoted 9 lines · Patrick McHardy
Quoted 5 lines · chengq
Quoted 5 lines
Quoted 5 lines

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 .

Quoted 8 lines

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw
Quoted 11 lines · Patrick McHardy
Quoted 3 lines · Benbenshi

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!

Quoted 8 lines
Quoted 3 lines

can you tell more details ?

Just try yourself.

#7 lore raw
Quoted 8 lines · Benbenshi

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,

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