Re: bird 2.0.2 does not propagate krt_metric set in static routes when exporting to kernel (and couple other small issues in static protocol)

2018-04-15 Thread Alexander Demenshin

On 2018-04-15 06:42, Radu Anghel wrote:


You need to set metric 0; in your kernel protocol in order to have
custom krt_metric per route.


Now I see, thank you... how could I miss it in docu :)

Though, this has a nasty side effect - it is impossible to set "default"
metric on export and then override it using protocol options.

--
Best regards,
Alexander.



bird 2.0.2 does not propagate krt_metric set in static routes when exporting to kernel (and couple other small issues in static protocol)

2018-04-14 Thread Alexander Demenshin

Hi,

Looks like setting of krt_metric in bird 2.0.2 does not work like in 
bird 1.6.


Construction like:

protocol static static4 {
  route 0.0.0.0/0 via 1.1.1.1 {
krt_metric = 1;
  };
}

is accepted, I see the route exported to the kernel, but with default 
bird metric 32.


Yes, I know that bird can find the best route and install only that one, 
but I prefer
to keep several static routes installed with different metrics, when 
bird is used

only to keep them alive.

Another issue, when setting via scope using "%" notation, like:

  route 1.2.3.0/24 via 1.1.1.1 % ifname onlink on;

if "ifname" contains characters like "-" or ".", it will be rejected 
(syntax error),
while such names are perfectly legal (at least in linux). May be it 
makes sense
to allow quoted (TEXT instead of SYM) interface name for such cases (I 
tried to
extend grammar and it works perfectly - fix is trivial so there is no 
patch attached).


Small annoyance, though not an issue - "route" only accepts CIDR 
notation, though
it would be nice to omit "/32" for single IPs, as it looks more 
"natural".


Finally - looks like bird 2 docs is a bit incorrect - static route 
options
must be followed by ';' as a terminator (according to grammar), while 
documentation

lists them without, which produces "syntax error" without any details.

BTW, "onlink" is not documented at all, though I was really happy to 
find it :)


PS: As this is my first experience with bird v2 - many thanks - it is 
much better :)


--
With best regards,
Alexander.