Netdev List
 help / color / mirror / Atom feed
* Policy routing + route "via" gives a strange behavior
@ 2009-10-20 13:28 Guido Trotter
  2009-10-20 16:48 ` Atis Elsts
  0 siblings, 1 reply; 4+ messages in thread
From: Guido Trotter @ 2009-10-20 13:28 UTC (permalink / raw)
  To: netdev


Hi,

I'm seeing what I think might be a strange kernel behavior when setting up a
route "via" a gateway, with policy routing. When adding a route with a gateway,
the kernel accepts it only if the gateway is reachable via that device. For
example:

ip route add default dev eth1 via 192.168.5.254

is only accepted if there is a route like:
192.168.5.0/24 dev eth1 scope link

in the main routing table. which, of course, is ok, otherwise the kernel
wouldn't be able to reach 192.168.5.254 in the first place.

Now, when adding policy routing to the mix, if I do:
ip route add table 100 default dev eth1 via 192.168.5.254

This is also refused unless a route like the one before appears in the default
table, even though it does appear in table 100. Is this the right behavior, and
if yes, why? It seems to me that it should be acceptable to have the network
route as well just in the separate routing table, since the "via" will only be
used by traffic hitting that table anyway.

Thanks a lot,

Guido


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

end of thread, other threads:[~2009-10-21  8:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-20 13:28 Policy routing + route "via" gives a strange behavior Guido Trotter
2009-10-20 16:48 ` Atis Elsts
2009-10-20 17:23   ` Guido Trotter
2009-10-21  8:47     ` Mallika Gautam

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