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

Attachment: pgpMIcbpxM_SQ.pgp
Description: PGP signature

_______________________________________________
Babel-users mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/babel-users

Reply via email to