Can you try the solution suggested in the comment of the github issue https://github.com/FRRouting/frr/issues/10009?

Specifically, with the command
set ipv6 next-hop prefer-global
in the route-map context.

Shelton 

On Tue, Mar 15, 2022 at 6:19 AM SANDEEP KUMAR <sandeepkumar2016000@gmail.com> wrote:
Hi All,

BGP connection between 2 Nodes with IPv6 on global IPs and want to route via global ipv6 address not via ipv6 link local address

I have made the bgp connection with global ipv6 address of interface and advertising the ipv6 route when advertising the route then bgp route added on Node2 for 2003:4001:5001::/64 via fe80::6548:ed45:d5d:b578:link address of Node1  but i want route with via  5001:1::9 global ipv6 address (2003:4001:5001::/64 via 5001:1::9) 
Similarly when we advertise 8001:1::/64 from Node2, So want help so that I can achieve the bgp route added on Node1 and Node2 via global ipv6 address not with ipv6 link address

    2003:4001:5001::/64 ------------[Node1]<===========================>[Node2]-------------8001:1::/64
                                                          ASN:65001                                                                                   ASN:65002
                                                          5001:1::9:global                                                                          5001:1::10:global
                                                          fe80::6548:ed45:d5d:b578:link                                                  fe80::2938:1046:591:8387:link

[Node1 configuration and interface info]
[root@localhost centosecmp]# ifconfig ens5|grep inet
        inet 10.5.10.9  netmask 255.255.255.0  broadcast 10.5.10.255
        inet6 5001:1::9  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::6548:ed45:d5d:b578  prefixlen 64  scopeid 0x20<link>

localhost.localdomain(config-router)# do show running-config
Building configuration...

Current configuration:
!
frr version 7.2
frr defaults traditional
hostname localhost.localdomain
!
router bgp 65001
 bgp router-id 1.1.1.1
 no bgp default ipv4-unicast
 neighbor 5001:1::10 remote-as 65002
 !
 address-family ipv6 unicast
  network 2003:4001:5001::/64
  neighbor 5001:1::10 activate
 exit-address-family

!
line vty
!
end
localhost.localdomain(config-router)# do show ip bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 1.1.1.1, local AS number 65001 vrf-id 0
BGP table version 2
RIB entries 3, using 552 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
5001:1::10      4      65002       7       7        0    0    0 00:02:13            1

Total number of neighbors 1
localhost.localdomain(config-router)# do show ipv6 route bgp
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

B>* 8001:1::/64 [20/0] via fe80::2938:1046:591:8387, ens5, 00:02:19
  

[Node2 configuration and interface info]
[root@localhost centosecmp]# ifconfig ens4|grep inet
        inet 10.5.10.10  netmask 255.255.255.0  broadcast 10.5.10.255
        inet6 fe80::2938:1046:591:8387  prefixlen 64  scopeid 0x20<link>
        inet6 5001:1::10  prefixlen 64  scopeid 0x0<global>

localhost.localdomain(config-router)# do show running-config
Building configuration...

Current configuration:
!
frr version 7.2
frr defaults traditional
hostname localhost.localdomain
!
router bgp 65002
 bgp router-id 222.222.222.222
 no bgp default ipv4-unicast
 neighbor 5001:1::9 remote-as 65001
 !
 address-family ipv6 unicast
  network 8001:1::/64
  neighbor 5001:1::9 activate
 exit-address-family

!
line vty
!
end
localhost.localdomain(config-router)# do show ip bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 222.222.222.222, local AS number 65002 vrf-id 0
BGP table version 2
RIB entries 3, using 552 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
5001:1::9       4      65001       9       9        0    0    0 00:04:48            1

Total number of neighbors 1
localhost.localdomain(config-router)# do show ipv6 route bgp
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

B>* 2003:4001:5001::/64 [20/0] via fe80::6548:ed45:d5d:b578, ens4, 00:05:08

Thanks & Regards,
Sandeep Kumar


_______________________________________________
dev mailing list
dev@lists.frrouting.org
https://lists.frrouting.org/listinfo/dev