Re: Fwd: SO_BINDTODEVICE: No such device for BGP with VRF configuration

Maria Matejka maria.matejka at nic.cz
Tue Jan 3 08:12:38 CET 2023


Hello!

The error message says that BIRD can't find the VRF. Have you configured it in kernel properly? How does your "ip link" command output look like?

Maria


On 3 January 2023 04:41:51 CET, Ramanathan Selvamani via Bird-users <bird-users at trubka.network.cz> wrote:
>Hi all,
>
>I am using linux kernel 4.14.188. While i'm trying to configure VRF for
>BGP, i observed the below error and BGP session is not established.
>Kindly let me know if i am missing anything.
>
>At R1
>====
>B_VRF_RED: Socket error: SO_BINDTODEVICE: No such device
>B_VRF_RED: Connection closed
>
>At R2
>====
>B_VRF_RED: Socket error: SO_BINDTODEVICE: No such device
>
>R1 Configuration
>=============
>function oro_set_bgp_local_as() {
>        bgp_path.prepend(100);
>        return true;
>}
>function bgp_aggr_nets()
>{
>}
>function redistribute_proto()
>{
>        if ((source = RTS_BGP)) then {
>                return true;
>        }
>        if (net=0.0.0.0/0) then { return false;}
>        if ((source = RTS_DEVICE)) then {
>                 return false;
>        }
>        if (source = RTS_STATIC) then {
>                if(net=0.0.0.0/0) then { return false;}
>                if (ifname = "lo") then {
>                        return false;
>                } else {
>                        return false;
>                }
>        }
>        if ((source = RTS_CFGSET)) then {
>                 return false;
>        }
>        if ((source = RTS_IAPVPN)) then {
>                 return false;
>        }
>        if ((source = RTS_OAP)) then {
>                 return false;
>        }
>        if (source = RTS_OSPF) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_IA) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_EXT1) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_EXT2) then {
>                 return false;
>        }
>        if ((source = RTS_OSPF) || (source = RTS_OSPF_IA) || (source =
>RTS_OSPF_EXT1) || (source = RTS_OSPF_EXT2)) then {
>                 return false;
>        }
>        return false;
>}
>filter export_BGP_50_0_0_2 {
>        if ((scope = SCOPE_HOST) && (dest != RTD_BLACKHOLE)) then {
>                reject;
>        }
>        if (source = RTS_APP) then {
>                reject;
>        }
>        if (source = RTS_REDIRECT) then {
>                reject;
>        }
>        if (source = RTS_INHERIT) then {
>                reject;
>        }
>        if ((source = RTS_OAP) && defined(oap_metric)) then {  bgp_med =
>oap_metric; }
>        if !redistribute_proto() then {reject;}
>
>         if( rmap_r1(bgp_proto)) then {accept;}
>         else{reject;}
>
>        accept;
>}
>filter import_BGP_50_0_0_2 {
>        if((source = RTS_BGP) && rmap_r1(bgp_proto)) then {
>                 accept;
>        } else {
>                 reject;
>        }
>}
>protocol bgp BGP_50_0_0_2 {
>        router id 1.1.1.1;
>        local as 100;
>        neighbor 50.0.0.2 as 100;
>        graceful restart off;
>        graceful restart time 90;
>        enable as4 on;
>        hold time 90;
>        keepalive time 30;
>        prefer older on;
>        ipv4 {
>                preference 56;
>                import table on;
>                export table on;
>                import filter import_BGP_50_0_0_2;
>                export filter export_BGP_50_0_0_2;
>        };
>}
>R2 Configuration
>=============
>ipv4 table T_VRF_RED;
>
>function oro_set_bgp_local_as() {
>        bgp_path.prepend(100);
>        return true;
>}
>function redistribute_proto()
>{
>        if ((source = RTS_BGP)) then {
>                return true;
>        }
>        if (net=0.0.0.0/0) then { return false;}
>        if ((source = RTS_DEVICE)) then {
>                 return false;
>        }
>        if (source = RTS_STATIC) then {
>                if(net=0.0.0.0/0) then { return false;}
>                if (ifname = "lo") then {
>                        return false;
>                } else {
>                        return false;
>                }
>        }
>        if ((source = RTS_CFGSET)) then {
>                 return false;
>        }
>        if ((source = RTS_IAPVPN)) then {
>                 return false;
>        }
>        if ((source = RTS_OAP)) then {
>                 return false;
>        }
>        if (source = RTS_OSPF) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_IA) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_EXT1) then {
>                 return false;
>        }
>        if (source = RTS_OSPF_EXT2) then {
>                 return false;
>        }
>        if ((source = RTS_OSPF) || (source = RTS_OSPF_IA) || (source =
>RTS_OSPF_EXT1) || (source = RTS_OSPF_EXT2)) then {
>                 return false;
>        }
>        return false;
>}
>protocol kernel K_VRF_RED {
>        vrf "red";
>        kernel table 100;
>        scan time 20;
>
>        ipv4 {
>                table T_VRF_RED;
>                import all;
>                export all;
>        };
>}
>
>protocol direct C_VRF_RED {
>        vrf "red";
>        ipv4 { table T_VRF_RED; };
>        interface "red";
>}
>
>protocol static S_VRF_RED {
>        vrf "red";
>        ipv4 { table T_VRF_RED; };
>
>        route 10.10.1.0/24 blackhole;
>}
>
>protocol bgp B_VRF_RED {
>        vrf "red";
>        router id 2.2.2.2;
>        local 50.0.0.2 as 100;
>        neighbor 50.0.0.1  as 100;
>        enable as4 on;
>        hold time 90;
>        keepalive time 30;
>        multihop;
>        strict bind yes;
>        # regular IPv4 unicast (1/1)
>        ipv4 {
>                table T_VRF_RED;
>                import all;
>                export all;
>        };
>}
>
>
>Thanks,
>Ramanathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20230103/bc25734a/attachment.htm>


More information about the Bird-users mailing list