bgp template inheritance

David Petera david.petera at nic.cz
Tue Mar 3 14:38:18 CET 2026


Hi Cédric,

inheritance of filters is not supported, but you can make use of 
functions (https://bird.nic.cz/doc/bird-2.18.html#filters) to not repeat 
yourself.

We are glad that you are switching to v2/v3. You will most likely be 
able to use the same exact configuration for v2 and v3.

Hope this helps and happy routing,
David

David Petera (he/him) | BIRD Tech Support | CZ.NIC, z.s.p.o.

On 3/3/26 12:40, BASSAGET Cédric wrote:
> Hello,
>
> I'm trying to simplify my old bird 1.6 config, the aim is migrating to 
> v2 then v3.
>
>
> I have a config like :
>
> template bgp private_peering_ipv4 {
>     local as my_ans;
>     path metric 2;
>     ipv4 {
>             import all;
>             import filter {
>                 if (net.len > 24 ) then reject;
>                 bgp_large_community.add((my_asn, 1, 1003));
>                 accept;
>             };
>             export filter export_my_routes_ipv4;
>             import keep filtered;
>     };
> }
>
> protocol bgp PEER_v4_peer1 from private_peering_ipv4 {
>     router id 195.42.145.x;
>     neighbor 195.42.144.104 as 6939;
> }
> protocol bgp PEER_v4_peer2 from private_peering_ipv4 {
>     router id 195.42.145.x;
>     neighbor 195.42.144.104 as 6939;
>     ipv4 {
>             import filter {
>                 bgp_large_community.add((my_asn, 1, 1009));
>                 accept;
>             };
>    };
> }
>
>
>
> the problem here is that as soon as I define a new import filter for 
> my second peer, the filter from the template is omitted.
>
> Is there a way to add inheritance between the templates, or anything 
> else that wouldn't overwrite the template filters ?
>
> Regards,
> Cédric
>


More information about the Bird-users mailing list