How to make BIRD use the kernel routing metric?

Ondrej Zajicek santiago at crfreenet.org
Wed Nov 14 14:49:28 CET 2018


On Wed, Nov 14, 2018 at 10:13:31AM +0100, Clemens Schrimpe wrote:
> > Not sure how to achieve the same in BIRD.
> 
> While you are at it … (sorry for riding along on your thread)
> 
> It raises the general question of „how does one extract certain data from different protocols“, i.e. into a variable so it can be „mathed“ with and then re-used in an im- or export filter to be translated into another protocol’s metric.
> 
> So in your case: Can the krt_metric attribute of routes „learned“ from the kernel be read and stored in a variable?

Well, krt_metric is already accessible for whole existence of the route.
You could store it to a filter-local variable, or you could use it
directly in computation. You could even do things like:

  if krt_metric < 1000
  then ospf_metric1 = krt_metric * 10;
  else ospf_metric2 = krt_metric - 1000;


> In my case: How can I read the contents of each part of the
> tuplets/triplets from BGP communities? So far I only know of ways to test
> for the existence of particular values. (i.e. get the third part of a BGP
> large community with known first & second parts into a variable)

The issue here is more that we does not have feature to iterate
through sets/lists, e.g. AS_PATH and COMMUNITY attribute.

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."



More information about the Bird-users mailing list