* route trouble with kernel
@ 2005-06-28 12:57 cigarette Chan
2005-06-28 13:45 ` Richard B. Johnson
2005-06-28 14:00 ` Valdis.Kletnieks
0 siblings, 2 replies; 4+ messages in thread
From: cigarette Chan @ 2005-06-28 12:57 UTC (permalink / raw)
To: linux-kernel
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: route trouble with kernel
2005-06-28 12:57 route trouble with kernel cigarette Chan
@ 2005-06-28 13:45 ` Richard B. Johnson
2005-06-29 2:17 ` Benbenshi
2005-06-28 14:00 ` Valdis.Kletnieks
1 sibling, 1 reply; 4+ messages in thread
From: Richard B. Johnson @ 2005-06-28 13:45 UTC (permalink / raw)
To: cigarette Chan; +Cc: Linux kernel
It could be argued that if `iptables` retains its
parameters after its only interface has been shut
down it's a bug.
The fact that no routes remain after a network
interface has been shut down is both logical
and in conformance with de facto Unix standards.
This is partially as a result of route's manipulating
flags (the UP flag would be wrong if the interface
was down).
I can't imagine that you have so many routes
that it takes a significant amount of time to
reset them using a script. If so, you probably
have a configuration error where you are
not properly using netmasks. Certainly, you
shouldn't have to establish a host-route for
every host on your network. You only need a
network route (out the interface) and a
default route that goes to some router to get
out of your LAN. Even if you __are__ a router,
the network setup remains about the same,
only the user-mode software changes, which
may dynamically alter the routing tables.
On Tue, 28 Jun 2005, cigarette Chan wrote:
> 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.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: route trouble with kernel
2005-06-28 12:57 route trouble with kernel cigarette Chan
2005-06-28 13:45 ` Richard B. Johnson
@ 2005-06-28 14:00 ` Valdis.Kletnieks
1 sibling, 0 replies; 4+ messages in thread
From: Valdis.Kletnieks @ 2005-06-28 14:00 UTC (permalink / raw)
To: cigarette Chan; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
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 #2: Type: application/pgp-signature, Size: 226 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: route trouble with kernel
2005-06-28 13:45 ` Richard B. Johnson
@ 2005-06-29 2:17 ` Benbenshi
0 siblings, 0 replies; 4+ messages in thread
From: Benbenshi @ 2005-06-29 2:17 UTC (permalink / raw)
To: linux-os, linux-kernel, zhuangyy
Richard B. Johnson wrote:
>
> It could be argued that if `iptables` retains its
> parameters after its only interface has been shut
> down it's a bug.
>
> The fact that no routes remain after a network
> interface has been shut down is both logical
> and in conformance with de facto Unix standards.
> This is partially as a result of route's manipulating
> flags (the UP flag would be wrong if the interface
> was down).
>
> I can't imagine that you have so many routes
> that it takes a significant amount of time to
> reset them using a script. If so, you probably
> have a configuration error where you are
> not properly using netmasks. Certainly, you
> shouldn't have to establish a host-route for
> every host on your network. You only need a
> network route (out the interface) and a
> default route that goes to some router to get
> out of your LAN. Even if you __are__ a router,
> the network setup remains about the same,
> only the user-mode software changes, which
> may dynamically alter the routing tables.
>
> On Tue, 28 Jun 2005, cigarette Chan wrote:
>
>> 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.
>
>
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
> Notice : All mail here is now cached for review by Dictator Bush.
> 98.36% of all statistics are fiction.
>
my host is a vpn gateway, and i have several virtual interface to run
vpn. ie tap0, tap1....
I have to add routes to these TAPs to make vpn work. but after i restart
the tapX, i have
to re-add routes relate to this interface~
If i have to maintain several vpn and lots of TAPs , So i need a simple
way to maintian route tables.
sometimes it's quite diffcult to do this with shell scipts ,especially
when it's quite complex.
thanks~
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-06-29 2:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-28 12:57 route trouble with kernel cigarette Chan
2005-06-28 13:45 ` Richard B. Johnson
2005-06-29 2:17 ` Benbenshi
2005-06-28 14:00 ` Valdis.Kletnieks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox