{"id":1670,"date":"2025-11-03T20:36:13","date_gmt":"2025-11-03T18:36:13","guid":{"rendered":"https:\/\/www.mcgill.org.za\/stuff\/?p=1670"},"modified":"2025-11-04T08:21:52","modified_gmt":"2025-11-04T06:21:52","slug":"frr-says-finite-state-machine-error-for-ipv6-bgp-on-linux","status":"publish","type":"post","link":"https:\/\/www.mcgill.org.za\/stuff\/archives\/1670","title":{"rendered":"FRR says &#8220;Finite State Machine Error&#8221; for IPv6 BGP on Linux"},"content":{"rendered":"\n<p>If you turn off link-local addresses for the interface (those horrible 169.254.50.231 type addresses, and also the IPv6 <code>fe80::dead:beef:4:f00d\/64<\/code> things), FRR goes sulky. In netplan, it looks like this:<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"alignright size-full\"><a href=\"https:\/\/www.mcgill.org.za\/stuff\/wp-content\/uploads\/2025\/11\/fsm.webp\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"126\" src=\"https:\/\/www.mcgill.org.za\/stuff\/wp-content\/uploads\/2025\/11\/fsm.webp\" alt=\"FSM\" class=\"wp-image-1672\"\/><\/a><figcaption class=\"wp-element-caption\">The official mascot of the BGP Finite State Machine (FSM)<\/figcaption><\/figure>\n<\/div>\n\n\n<pre class=\"wp-block-code\"><code>ethernets:\n  eth0:\n    <strong>link-local: &#91; ]<\/strong><\/code><\/pre>\n\n\n\n<p>When FRR is sulky, it says it will advertise IPv6 subnets, but its doesn&#8217;t actually advertise the routes, because it doesn&#8217;t actually connect to its peer(s).  Here says it will advertise, but it doesn&#8217;t:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># show ip bgp all\n...\nNetwork Next Hop Metric LocPrf Weight Path\n*&gt; 2000:deaf:7012:feed::\/64 :: 0 32768 i<\/code><\/pre>\n\n\n\n<p><code>tcpdump<\/code> says this, which doesn&#8217;t help much:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># tcpdump -i any port bgp\n17:27:49.667454 eth0  Out ifindex 3 52:54:00:a1:34:67 ethertype IPv6 (0x86dd), length 113: (class 0xc0, flowlabel 0xdde41, hlim 1, next-header TCP (6) payload length: 53) 2000:deaf::1194.45245 &gt; 2000:deaf::80.179: Flags &#91;P.], cksum 0x445a (incorrect -&gt; 0xdc08), seq 1:22, ack 1, win 507, options &#91;nop,nop,TS val 3099884752 ecr 3196106109], length 21: BGP\n\tNotification Message (3), length: 21, <strong>Finite State Machine Error (5) subcode Unspecified Error (0)<\/strong><\/code><\/pre>\n\n\n\n<p>To turn on debug, it&#8217;s a few easy and obvious commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># vtysh\nconfig term\ndebug bgp as4\ndebug bgp bfd\ndebug bgp flowspec\ndebug bgp keepalives\ndebug bgp neighbor-events\ndebug bgp pbr\ndebug bgp updates\ndebug bgp vpn\ndebug bgp bestpath\ndebug bgp evpn\ndebug bgp graceful-restart\ndebug bgp labelpool\ndebug bgp nht\ndebug bgp update-groups\ndebug bgp vnc\ndebug bgp zebra\nlog syslog debug\nend\nterminal monitor<\/code><\/pre>\n\n\n\n<p>And then the terminal displays all the debug you could want, including the confession below that FRR&#8217;s BGP on IPv6 cannot function without a link-local address.  I suppose some IPv6 routers don&#8217;t like routing without a Link-Local to talk to &#8230; or it&#8217;s in the standard, or something stupid:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.336 &#91;DEBG] bgpd: &#91;YTARA-Q9ZD1] &#91;Event] BGP connection from host 2000:deaf::80 fd 27\n.336 &#91;DEBG] bgpd: &#91;JYX7T-SMTAQ] bgp_peer_gr_init called ..\n.336 &#91;DEBG] bgpd: &#91;YB7SD-E2DZS] &#91;BGP_GR] Peer state changed  --to--&gt;  : 4 : !\n.336 &#91;DEBG] bgpd: &#91;VTCGN-KEKBQ] bgp_peer_gr_flags_update &#91;BGP_GR] called !\n.336 &#91;DEBG] bgpd: &#91;VBM1Z-TD8QM] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_HELPER : Set : !\n.336 &#91;DEBG] bgpd: &#91;M49N5-G8MHD] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART : UnSet : !\n.336 &#91;DEBG] bgpd: &#91;SRJ2F-0FBJK] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_GLOBAL_INHERIT : Set : !\n.336 &#91;DEBG] bgpd: &#91;VTCGN-KEKBQ] bgp_peer_gr_flags_update &#91;BGP_GR] called !\n.336 &#91;DEBG] bgpd: &#91;VBM1Z-TD8QM] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_HELPER : Set : !\n.336 &#91;DEBG] bgpd: &#91;M49N5-G8MHD] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART : UnSet : !\n.336 &#91;DEBG] bgpd: &#91;SRJ2F-0FBJK] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_GLOBAL_INHERIT : Set : !\n.336 &#91;DEBG] bgpd: &#91;WNKP5-SN018] Found existing bnc 2000:deaf::1\/128(0)(VRF default) flags 0xf ifindex 0 #paths 0 peer 0x7ebfd9c26031\n.336 &#91;DEBG] bgpd: &#91;T91AW-FGMHW] bgp_fsm_change_status : vrf default(0), Status: Active established_peers 0\n.336 &#91;DEBG] bgpd: &#91;ZQHFG-DQGX1] 2000:deaf::1 went from Idle to Active\n.337 &#91;DEBG] bgpd: &#91;ZWCSR-M7FG9] 2000:deaf::1 &#91;FSM] TCP_connection_open (Active-&gt;OpenSent), fd 27\n.337 &#91;WARN] bgpd: &#91;ZM2F8-MV4BJ]&#91;EC 33554509] <strong>Interface: eth0 does not have a v6 LL address associated with it, waiting until one is created for it<\/strong>\n.337 &#91;ERR!] bgpd: &#91;M3MYP-BVWDS]&#91;EC 33554460] 2000:deaf::1: nexthop_set failed, resetting connection - intf eth0\n.337 &#91;ERR!] bgpd: &#91;NQGZV-Y3W62]&#91;EC 100663299] bgp_connect_success: bgp_getsockname(): failed for peer 2000:deaf::1, fd 27\n.337 &#91;INFO] bgpd: &#91;HZN6M-XRM1G] %NOTIFICATION: sent to neighbor 2000:deaf::1 5\/0 (Neighbor Events Error\/Unspecific) 0 bytes\n.337 &#91;DEBG] bgpd: &#91;VTCGN-KEKBQ] bgp_peer_gr_flags_update &#91;BGP_GR] called !\n.337 &#91;DEBG] bgpd: &#91;VBM1Z-TD8QM] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_HELPER : Set : !\n.337 &#91;DEBG] bgpd: &#91;M49N5-G8MHD] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART : UnSet : !\n.337 &#91;DEBG] bgpd: &#91;SRJ2F-0FBJK] &#91;BGP_GR] Peer 2000:deaf::1 Flag PEER_FLAG_GRACEFUL_RESTART_GLOBAL_INHERIT : Set : !\n.337 &#91;DEBG] bgpd: &#91;ZWCSR-M7FG9] 2000:deaf::1 &#91;FSM] BGP_Stop (Active-&gt;Idle), fd 27\n.339 &#91;DEBG] bgpd: &#91;T91AW-FGMHW] bgp_fsm_change_status : vrf default(0), Status: Deleted established_peers 0\n.339 &#91;DEBG] bgpd: &#91;ZQHFG-DQGX1] 2000:deaf::1 went from Active to Deleted\n\nTo turn on link-local for \n<\/code><\/pre>\n\n\n\n<p>And the problem is fixed by turning on the (rather default) link-local address for IPv6.  In netplan, it&#8217;s this part:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ethernets:\n  eth0:\n    <strong>link-local: &#91; ipv6 ]<\/strong><\/code><\/pre>\n\n\n\n<p>And <em>then<\/em> it works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you turn off link-local addresses for the interface (those horrible 169.254.50.231 type addresses, and also the IPv6 fe80::dead:beef:4:f00d\/64 things), FRR goes sulky. In netplan, it looks like this: When FRR is sulky, it says it will advertise IPv6 subnets, &hellip; <a href=\"https:\/\/www.mcgill.org.za\/stuff\/archives\/1670\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1672,"comment_status":"open","ping_status":null,"sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[341,342,310,33,190,11],"class_list":["post-1670","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-stuff","tag-bgp","tag-frr","tag-ipv6","tag-networking","tag-stuff","tag-stupidity"],"_links":{"self":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/comments?post=1670"}],"version-history":[{"count":6,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1670\/revisions"}],"predecessor-version":[{"id":1677,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/posts\/1670\/revisions\/1677"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media\/1672"}],"wp:attachment":[{"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/media?parent=1670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/categories?post=1670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mcgill.org.za\/stuff\/wp-json\/wp\/v2\/tags?post=1670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}