Bug 286111 - net/frr10: FRR cant install rfc5549 routes into kernel
Summary: net/frr10: FRR cant install rfc5549 routes into kernel
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Olivier Cochard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-15 13:12 UTC by Egor
Modified: 2025-04-24 14:47 UTC (History)
3 users (show)

See Also:


Attachments
Jail config (3.69 KB, text/plain)
2025-04-15 13:12 UTC, Egor
no flags Details
Frr config (5.04 KB, text/plain)
2025-04-15 13:27 UTC, Egor
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egor 2025-04-15 13:12:55 UTC
Created attachment 259581 [details]
Jail config

I tried to use ipv6 link-local addresses for bgp and i faced with a problem. Frr couldn't install ipv4 routes with ipv6 nexthops in the kernel routing table although this routes exists in frr. I ran frr inside jail with FreeBSD 14.2 and tried ran it without jail but in both cases i got the same result. Also i tried to use three different versions of frr 8,9 and 10 but nothing changed. The error was the same. There is log from jail with FreeBSD 14.2 and FRR 10.

2025/04/15 12:26:41 ZEBRA: [XASXT-GF69Y] kernel_rtm: No useful nexthops were found in RIB prefix 172.16.180.0/27
2025/04/15 12:26:41 ZEBRA: [RV5F2-MQGZG][EC 100663303] kernel_rtm: 172.16.180.0/27: rtm_write() unexpectedly returned -2 for command RTM_ADD
2025/04/15 12:26:41 ZEBRA: [RV5F2-MQGZG][EC 100663303] kernel_rtm: 172.16.180.0/27: rtm_write() unexpectedly returned -2 for command RTM_ADD

test-fw01_jail# show ip route 172.16.180.0/27
Routing entry for 172.16.180.0/27
  Known via "bgp", distance 20, metric 0, best
  Last update 00:03:26 ago
  * fe80::6e4e:f6ff:fe79:85a8, via mce0.1270, weight 1
  * fe80::d209:c8ff:feca:928, via mce1.1270, weight 1

test-fw01_jail# show ip bgp 172.16.180.0/27
BGP routing table entry for 172.16.180.0/27, version 43
Paths: (2 available, best #1, table default)
  Advertised to non peer-group peers:
  mce0.3100 mce1.3100
  4230041270
    fe80::d209:c8ff:feca:928 from mce1.1270 (192.168.255.54)
    (fe80::d209:c8ff:feca:928) (used)
      Origin incomplete, valid, external, multipath, bestpath-from-AS 4230041270, best (Older Path)
      Extended Community: RT:23456:270
      Last update: Tue Apr 15 12:24:22 2025
  4230041270
    fe80::6e4e:f6ff:fe79:85a8 from mce0.1270 (192.168.255.56)
    (fe80::6e4e:f6ff:fe79:85a8) (used)
      Origin incomplete, valid, external, multipath
      Extended Community: RT:23456:270
      Last update: Tue Apr 15 12:26:41 2025

# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags         Netif Expire
127.0.0.1          link#8             UH              lo0

Internet6:
Destination                       Gateway                       Flags         Netif Expire
::/96                             link#8                        URS             lo0
::1                               link#8                        UHS             lo0
::ffff:0.0.0.0/96                 link#8                        URS             lo0
fe80::%lo0/10                     link#8                        URS             lo0
fe80::%lo0/64                     link#8                        U               lo0
fe80::1%lo0                       link#8                        UHS             lo0
fe80::%mce0.1240/64               link#11                       U         mce0.1240
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1240/64               link#12                       U         mce1.1240
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1250/64               link#13                       U         mce0.1250
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1250/64               link#14                       U         mce1.1250
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1260/64               link#15                       U         mce0.1260
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1260/64               link#16                       U         mce1.1260
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1270/64               link#17                       U         mce0.1270
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1270/64               link#18                       U         mce1.1270
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1280/64               link#19                       U         mce0.1280
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1280/64               link#20                       U         mce1.1280
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1310/64               link#21                       U         mce0.1310
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1310/64               link#22                       U         mce1.1310
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.1490/64               link#23                       U         mce0.1490
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.1490/64               link#24                       U         mce1.1490
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.3100/64               link#25                       U         mce0.3100
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.3100/64               link#26                       U         mce1.3100
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
fe80::%mce0.3101/64               link#27                       U         mce0.3101
fe80::ba3f:d2ff:fe1c:e208%lo0     link#8                        UHS             lo0
fe80::%mce1.3101/64               link#28                       U         mce1.3101
fe80::ba3f:d2ff:fe1c:e209%lo0     link#8                        UHS             lo0
ff02::/16                         link#8                        URS             lo0
Comment 1 Egor 2025-04-15 13:27:46 UTC
Created attachment 259583 [details]
Frr config
Comment 2 Egor 2025-04-15 14:51:08 UTC
I also tried to add route manually but i got a error

# route add -net 172.16.180.0/27 fe80::6e4e:f6ff:fe79:85a8
route: bad address: fe80::6e4e:f6ff:fe79:85a8
Comment 3 Egor 2025-04-15 14:51:19 UTC
I also tried to add route manually but i got a error

# route add -net 172.16.180.0/27 fe80::6e4e:f6ff:fe79:85a8
route: bad address: fe80::6e4e:f6ff:fe79:85a8
Comment 4 Marek Zarychta 2025-04-15 15:23:54 UTC
(In reply to Egor from comment #2)
Gateway is from another family and is IPv6 link-local address, so you need the scope. This command should work: 
route add -net 172.16.180.0/27 -inet6  fe80::6e4e:f6ff:fe79:85a8%em0
Comment 5 Marek Zarychta 2025-04-15 15:32:37 UTC
(In reply to Marek Zarychta from comment #4)
Of course, the scope is different, so it should be:

route add -net 172.16.180.0/27 -inet6  fe80::6e4e:f6ff:fe79:85a8%mce0.1270

I am unsure if it is a bug, misconfiguration or FRR deficiency (perhaps it needs patching to support IP router with IPv6 nexthops under FreeBSD), but with net/bird2 such scenarios work fine.
Comment 6 Egor 2025-04-24 11:57:23 UTC
It doesn't work in bird2 because it can't automatic discovery neighbors with link-local addresses and you forced to configure ipv6 link-local address of neighbor manually. It's inconvenient. So if you want to use bgp ipv6 peer auto discovery and announce ipv4 routes you don't have any solution for it of FreeBSD.
Comment 7 Marek Zarychta 2025-04-24 14:47:31 UTC
(In reply to Egor from comment #6)
>it doesn't work in bird2 because it can't automatic discovery neighbors with link-local addresses and you forced to configure ipv6 link-local address of neighbor manually.

Hmm.. but either way, you have to configure the peer's address in the BGP protocol to establish a session... unless you set  "bgp any peer". 
Is setting "bgp any peer" really your intention, and do you want to use link-local addresses for the IPv6-driven BGP session to distribute IPv4 routes?