Hello there, I'm a newbie to BIRD, using BIRD 1.6.3 and setting up my first router. I have multiple filters which filter different subnets and apply different attribute modifications. Currently I put my subnet checks in a function which returns true if a subnet matches, and invoke the function in a filter like this: function is_asxxxx() { if net ~ [114.51.4.0/24] then return true; return false; } function is_asyyyy() { if net ~ [19.19.81.0/24] then return true; return false; } filter f_customers { if is_asxxxx() then accept; if is_asyyyy() then { bgp_community.add((114514, 191981)); accept; } reject; } I'm wondering if I can invoke other filters inside a filter, so the is_asxxx can also used as an filter. I can't find an example to achieve this. Regards, Naoki Kobayashi
Hey Naoki, I am also relatively new to bird, however how I would solve the problem is by nesting functions. As far as I can see, you can accept/reject in functions, too - you are not limited to return true/false. Best, Nico amphineko <sukareki@gmail.com> writes:
Hello there,
I'm a newbie to BIRD, using BIRD 1.6.3 and setting up my first router. I have multiple filters which filter different subnets and apply different attribute modifications.
Currently I put my subnet checks in a function which returns true if a subnet matches, and invoke the function in a filter like this:
function is_asxxxx() { if net ~ [114.51.4.0/24] then return true; return false; }
function is_asyyyy() { if net ~ [19.19.81.0/24] then return true; return false; }
filter f_customers { if is_asxxxx() then accept; if is_asyyyy() then { bgp_community.add((114514, 191981)); accept; } reject; }
I'm wondering if I can invoke other filters inside a filter, so the is_asxxx can also used as an filter. I can't find an example to achieve this.
Regards, Naoki Kobayashi
-- Your Swiss, Open Source and IPv6 Virtual Machine. Now on www.datacenterlight.ch.
amphineko, On 02/05/2019 09:00, amphineko wrote:
I'm wondering if I can invoke other filters inside a filter, so the is_asxxx can also used as an filter. I can't find an example to achieve this.
I can recommend taking at least one look at the following links for reference purposes. If they can provide the level of information you are looking for. That I do not know. o https://github.com/coloclue/kees_old/blob/master/staged-configs o https://wiki.dn42.us/howto/Bird o https://github.com/Mic92/bird-dn42 -Christoffer
participants (3)
-
amphineko -
Hansen, Christoffer -
Nico Schottelius