[Babel-users] Redistribute a route on a specific interface only
Baptiste Jonglez
baptiste.jonglez at ens-lyon.fr
Fri Sep 6 06:34:31 UTC 2013
Hi,
Somebody on IRC wanted to redistribute a route on a specific interface
only. I call this "selective redistribute". Since the solution is
non-trivial, it might be interesting to others.
The "if" selector of the redistribute filter doesn't fulfil that
purpose: it only serves to match kernel routes by the interface they
refer to (e.g. "default via XXX **dev eth0**" will match a "if eth0"
selector).
The solution is to redistribute the route, and apply output filters.
This example redistributes the default route on br0 only:
redistribute ip 0.0.0.0/0 le 0 metric 128
out ip 0.0.0.0/0 le 0 if br0 allow
out ip 0.0.0.0/0 le 0 deny
Do note that the output filters will *also* filter out routes that are
not originated from us. I'm not sure whether this is a desirable
behaviour: one might want to selectively redistribute a given prefix,
but still advertise more specific routes (learnt elsewhere) on all
interfaces.
In any case, a hackish fix is to precisely match the routes one wants
to redistribute selectively (e.g. using the "eq" selector). A proper
fix would be to match our own router-id using the "id" selector, but
it's definitely not convenient. It's even worse with a random
router-id. Another solution would be to use the "neigh" selector, but
it probably won't match routes originated locally.
Any thoughts on this?
Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/babel-users/attachments/20130906/30a21b0d/attachment.sig>
More information about the Babel-users
mailing list