Policy routing + route "via" gives a strange behavior

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Guido Trotter
Date: Tuesday, October 20, 2009 - 6:28 am

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Policy routing + route "via" gives a strange behavior, Guido Trotter, (Tue Oct 20, 6:28 am)