Dynamic cost?

Mike Jones mike at mikejones.in
Wed Dec 21 19:52:43 CET 2016


Hi,

I have an OSPF based network using bird for routing the core and it
seems to work fine, however the network is geographically diverse and
some of the routing is sub-optimal. Specifically, the default route is
going shortest hops rather than lowest latency.

What I would like to do is have the OSPF cost reflect the latency of
the link, however I am having a problem coming up with a
scalable/automated way of doing this. As far as I can tell there is no
built in "latency to peer" I can reference? I could configure a manual
entry for each peer in the config file, however that doesn't seem very
manageable, even with some kind of script to generate the config file.

>From what I can gather there is no way for a filter to reference an
external file/database/script to adjust the routes on import. I even
considered a convoluted approach of having a script inject the peers
IP address in to a special kernel table and using the route metric to
feed numbers in to bird, but couldn't find a way of storing the data
and referencing it on a later route lookup.

Basically what I want is that when an OSPF peer comes up I ping it
then set the cost for all routes received from that neighbour to the
latency (with some basic sanity like a min and max). I don't expect
the latency to vary much once a link is up, however I do need to
auto-discover new peers appearing on the network.

Any ideas?

Thanks
- Mike Jones


More information about the Bird-users mailing list