Re: route trouble with kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Jun 2005 20:57:04 +0800, cigarette Chan said:
> i add a route to the kernel
> eg: # route add -net XXX.XXX.XXX.XXX/24 gw XXX.XXX.XXX.XXX dev eth1
> 
> but after i restart eth1
> 
> #ifdown eth1
> #ifup eth1
> 
> the route disappear,this make me a lot of troubles.i have several
> interfaces,and i have to
> re-add all of these routes...
> 
> Is there any way or patches to make route work like iptables,after i
> restart the interface,
> rules  are still there.

Your system should have a way of doing this in a callout during the ifup
and ifdown scripts.  Under Fedora, ifup calls ifup-post, which calls
/sbin/ifup-local - you could add your routes there.

More importantly, routes are different from iptables.  At worst, an iptable
rule has a dangling '-i ethX' match that will fail if the interface is down,
but that's a harmless because the packet isn't from that interface.

On the other hand, what is the kernel supposed to do with a route that
points to a down'ed ethX after you've done the ifdown, but before you've
done the ifup?  It may as well clear routes to the down'ed interface....

Attachment: pgpT9dDBH0kG9.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux