Limit OSPF interface pattern matching to VRFs

Marcel Menzel mail at mcl.gg
Sun Jan 22 15:32:52 CET 2023


Hello list,

Is there a way to instruct BIRD to only match OSPF interfaces that are 
enslaved to a certain VRF (or only the main VRF / not enslaved to any VRF)?

Trying to set 'vrf default;' or 'vrf "vrf-as207781";' in an OSPF 
protocol block does not generate any error message at all, but seems to 
be ignored completely.

Looking at "show ospf int" show BIRD picking up all interfaces (in my 
case xfrm and veth interfaces, because I match for "xfrm*" and "veth*") 
not belonging to the VRF specified.

The config block for running OSPF in the main VRF looks like this:

protocol ospf v3 o_home_ipv6 {
     vrf default;

     ipv6 {
         import all;
         export where source ~ [ RTS_DEVICE, RTS_STATIC ];
     };

     area 0 {
         interface "xfrm0", "xfrm2" {
         #interface "xfrm*" {
             hello 1;
             type pointopoint;
         };
         interface "br0" {
         #interface "br*" {
             stub;
         };
     };
}

The config block for running OSPF in one VRF looks like this:

protocol ospf v3 o_as207781_ipv6 {
     vrf "vrf-as207781";

     ipv6 {
         table t_as207781_ipv6;
         import all;
         export where source ~ [ RTS_DEVICE ];
     };

     area 0 {
         #interface "xfrm1", "xfrm3" {
         interface "xfrm*" {
             hello 1;
             type pointopoint;
         };
         #interface "veth0", "veth2", "dummy0" {
         interface "veth*", "dummy*" {
             stub;
         };
     };
}

Yet BIRD picks up all interfaces in all VRFs, although xfrm0 & xfrm2 are 
not enslaved, and xfrm1 & xfrm3 are VRF enslaved:

root at r1-fra ~ # birdc sh ospf int o_home_ipv6 | grep xfrm
Interface xfrm0 (IID 0)
Interface xfrm2 (IID 0)
Interface xfrm1 (IID 0)
Interface xfrm3 (IID 0)
root at r1-fra ~ # birdc sh ospf int o_as207781_ipv6 | grep xfrm
Interface xfrm1 (IID 0)
Interface xfrm3 (IID 0)
Interface xfrm0 (IID 0)
Interface xfrm2 (IID 0)

I am running BIRD 2.0.11 on Kernel 6.1.7. My current workaround is to 
specify each interface directly in the OSPF blocks without using any 
globbing/patterns at all, but this is getting uncomfortable for an 
increasing amount of interfaces (as I am planning to move to LXD routed 
mode and match it's veth interfaces automatically).


Thanks & kind regards,

Marcel Menzel


More information about the Bird-users mailing list