<html><head></head><body>Hello!<br><br>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?<br><br>Maria<br><br><br><div class="gmail_quote">On 3 January 2023 04:41:51 CET, Ramanathan Selvamani via Bird-users <bird-users@trubka.network.cz> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr">Hi all,<div><br></div><div>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.</div><div>Kindly let me know if i am missing anything.</div><div><br></div><div>At R1</div><div>====</div><div>B_VRF_RED: Socket error: SO_BINDTODEVICE: No such device<br></div><div>B_VRF_RED: Connection closed<br></div><div><br></div><div>At R2</div><div>====</div><div>B_VRF_RED: Socket error: SO_BINDTODEVICE: No such device<br></div><div><br></div><div>R1 Configuration</div><div>=============</div><div>function oro_set_bgp_local_as() {<br> bgp_path.prepend(100);<br> return true;<br>}<br>function bgp_aggr_nets()<br>{<br>}<br>function redistribute_proto()<br>{<br> if ((source = RTS_BGP)) then {<br> return true;<br> }<br> if (net=<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>) then { return false;}<br> if ((source = RTS_DEVICE)) then {<br> return false;<br> }<br> if (source = RTS_STATIC) then {<br> if(net=<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>) then { return false;}<br> if (ifname = "lo") then {<br> return false;<br> } else {<br> return false;<br> }<br> }<br> if ((source = RTS_CFGSET)) then {<br> return false;<br> }<br> if ((source = RTS_IAPVPN)) then {<br> return false;<br> }<br> if ((source = RTS_OAP)) then {<br> return false;<br> }<br> if (source = RTS_OSPF) then {<br> return false;<br> }<br> if (source = RTS_OSPF_IA) then {<br> return false;<br> }<br> if (source = RTS_OSPF_EXT1) then {<br> return false;<br> }<br> if (source = RTS_OSPF_EXT2) then {<br> return false;<br> }<br> if ((source = RTS_OSPF) || (source = RTS_OSPF_IA) || (source = RTS_OSPF_EXT1) || (source = RTS_OSPF_EXT2)) then {<br> return false;<br> }<br> return false;<br>}<br>filter export_BGP_50_0_0_2 {<br> if ((scope = SCOPE_HOST) && (dest != RTD_BLACKHOLE)) then {<br> reject;<br> }<br> if (source = RTS_APP) then {<br> reject;<br> }<br> if (source = RTS_REDIRECT) then {<br> reject;<br> }<br> if (source = RTS_INHERIT) then {<br> reject;<br> }<br> if ((source = RTS_OAP) && defined(oap_metric)) then { bgp_med = oap_metric; }<br> if !redistribute_proto() then {reject;}<br><br> if( rmap_r1(bgp_proto)) then {accept;}<br> else{reject;}<br><br> accept;<br>}<br>filter import_BGP_50_0_0_2 {<br> if((source = RTS_BGP) && rmap_r1(bgp_proto)) then {<br> accept;<br> } else {<br> reject;<br> }<br>}<br>protocol bgp BGP_50_0_0_2 {<br> router id 1.1.1.1;<br> local as 100;<br> neighbor 50.0.0.2 as 100;<br> graceful restart off;<br> graceful restart time 90;<br> enable as4 on;<br> hold time 90;<br> keepalive time 30;<br> prefer older on;<br> ipv4 {<br> preference 56;<br> import table on;<br> export table on;<br> import filter import_BGP_50_0_0_2;<br> export filter export_BGP_50_0_0_2;<br> };<br>}<br></div><div>R2 Configuration</div><div>=============</div><div>ipv4 table T_VRF_RED;<br><br>function oro_set_bgp_local_as() {<br> bgp_path.prepend(100);<br> return true;<br>}<br>function redistribute_proto()<br>{<br> if ((source = RTS_BGP)) then {<br> return true;<br> }<br> if (net=<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>) then { return false;}<br> if ((source = RTS_DEVICE)) then {<br> return false;<br> }<br> if (source = RTS_STATIC) then {<br> if(net=<a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a>) then { return false;}<br> if (ifname = "lo") then {<br> return false;<br> } else {<br> return false;<br> }<br> }<br> if ((source = RTS_CFGSET)) then {<br> return false;<br> }<br> if ((source = RTS_IAPVPN)) then {<br> return false;<br> }<br> if ((source = RTS_OAP)) then {<br> return false;<br> }<br> if (source = RTS_OSPF) then {<br> return false;<br> }<br> if (source = RTS_OSPF_IA) then {<br> return false;<br> }<br> if (source = RTS_OSPF_EXT1) then {<br> return false;<br> }<br> if (source = RTS_OSPF_EXT2) then {<br> return false;<br> }<br> if ((source = RTS_OSPF) || (source = RTS_OSPF_IA) || (source = RTS_OSPF_EXT1) || (source = RTS_OSPF_EXT2)) then {<br> return false;<br> }<br> return false;<br>}<br>protocol kernel K_VRF_RED {<br> vrf "red";<br> kernel table 100;<br> scan time 20;<br><br> ipv4 {<br> table T_VRF_RED;<br> import all;<br> export all;<br> };<br>}<br><br>protocol direct C_VRF_RED {<br> vrf "red";<br> ipv4 { table T_VRF_RED; };<br> interface "red";<br>}<br><br>protocol static S_VRF_RED {<br> vrf "red";<br> ipv4 { table T_VRF_RED; };<br><br> route <a href="http://10.10.1.0/24" target="_blank">10.10.1.0/24</a> blackhole;<br>}<br><br>protocol bgp B_VRF_RED {<br> vrf "red";<br> router id 2.2.2.2;<br> local 50.0.0.2 as 100;<br> neighbor 50.0.0.1 as 100;<br> enable as4 on;<br> hold time 90;<br> keepalive time 30;<br> multihop;<br> strict bind yes;<br> # regular IPv4 unicast (1/1)<br> ipv4 {<br> table T_VRF_RED;<br> import all;<br> export all;<br> };<br>}<br></div><div><br></div><div><br></div><div>Thanks,</div><div>Ramanathan</div></div>
</div></div>
</blockquote></div></body></html>