[uClibc] Offtopic: questions about restore linux route tables
Zhuang Yuyao
ihollo at tom.com
Mon Jul 4 09:23:22 UTC 2005
Hi,
Sorry for posting an offtopic question to this mail-list, but I have spent a lot of time in searching the web/usergroup but found no answer. So I think since I am already in this mail-list and here are many many *nix gurus working for embedded system also in this list, maybe this question is trivial to you guys but your answer will be great help to me.
I am working on an embedded system using linux as its OS. User can access this system through web browser, creat/modify/delete/apply static routes and bring up/down network interfaces. The question is when user bring down a network interface (eth*), the static route related to this interface is automatically removed by linux kernel.
i.e.
#ip route add default via 192.168.1.4 dev eth1
#ip route show dev eth1
192.168.1.0/24 proto kernel scope link src 192.168.1.5
default via 192.168.1.4
#ifconfig eth1 down
#ip route show dev eth1
***display nothing***
If I bring this interface up again:
#ifconfig eth1 192.168.1.5
#ip route show dev eth1
192.168.1.0/24 proto kernel scope link src 192.168.1.5
**The previous route "default via 192.168.1.4" disappeared. I have to add it manual again!**
On the contrary, iptables accepts unknown devices and takes effect when such an interface is available.
The question is: Is it possible to keep the route even the interface is unavailible until user EXPLICITLY deleted it? just as the iptables doing. Or, is there an elegant way to solve such a problem.
Sorry again for this offtopic question. Thanks very much.
Zhuang Yuyao
ihollo at tom.com
2005-07-04
More information about the uClibc
mailing list