bird bgp_mask/ regex with sets

Mazur, Dariusz dmazur at akamai.com
Fri Nov 22 16:01:05 CET 2019


Hello Bird users,

I am trying to  filter routing table entries based on as-path regex ( I try to write regex: 32934  (3|5|7) )

bird> show route all where bgp_path ~ [= 32934 [3,5,7] =]
syntax error, unexpected '['  -> I get this error
bird>

According to documentation I should be able  to use sets inside [=  =]

bgpmask
BGP masks are patterns used for BGP path matching (using path ~ [= 2 3 5 * =] syntax). The masks resemble wildcard patterns as used by UNIX shells. Autonomous system numbers match themselves, * matches any (even empty) sequence of arbitrary AS numbers and ? matches one arbitrary AS number. For example, if bgp_path is 4 3 2 1, then: bgp_path ~ [= * 4 3 * =] is true, but bgp_path ~ [= * 4 5 * =] is false. BGP mask expressions can also contain integer expressions enclosed in parenthesis and integer variables, for example [= * 4 (1+2) a =]. You can also use ranges (e.g. [= * 3..5 2 100..200 * =]) and sets (e.g. [= 1 2 [3, 5, 7] * =]).
I tried some other options mentioned in documentation and all works, only this one with sets doesn’t work:

bird> show route all where bgp_path ~ [= 32934 (4+1) =]  -> works
bird> show route all where bgp_path ~ [= 32934 1..5 =] -> works

Is it possible to use sets, or I faced bug?

Thanks,
Dariusz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20191122/41e9e523/attachment.htm>


More information about the Bird-users mailing list