Link local vs global v6 next hop for BGP rotuer

Ondrej Zajicek santiago at crfreenet.org
Tue Sep 20 18:11:10 CEST 2022


On Mon, Sep 19, 2022 at 01:23:28PM +0000, Mazur, Dariusz via Bird-users wrote:
> Hello,
> In my setup I have iBGP session with peer , and I learn v6 route. It is iBGP so we have 2 next hops global and link-local. By default bird uses link-local when route is exported to kernel. Is there any command to change this behavior and use global v6 address as BGP next hop when we export routes to kernel ?

Hello

The dual next hop for IPv6 routes is kind of hack and not really
reflected in filter code, which means that bgp_next_hop attribute
represents just global address. Therefore, you can do:

  bgp_next_hop = bgp_next_hop;

in remote IBGP export filter to reset bgp_next_hop attribute to just
its global address.

I think it would not work in local IBGP import filter - we assign
recursive immediate next hop based on bgp_next_hop when route is received
before import filter, so later change of bgp_next_hop in IBGP import
filter would not affect existing immediate next hop.

You can also change immediate next hop (route attribute 'gw'), either in
local IBGP import filter, or Kernel protocol export filter:

  gw = bgp_next_hop;

but that would work only if you have flat network and there is no
intermediate hop between local system and bgp_next_hop.


We probably should just add option to ignore link-local BGP next hops ...


> Table master6:
> fc00:2001:100:12::/64 unicast [2001:4878:c225::1:3:2__r02.ien.labkrk01.sdn 12:57:29.076] * (100) [i]
>                 via 2001:4878:c225::1:3:2 on eth-1\1\4
>                 Type: BGP univ
>                 BGP.origin: IGP
>                 BGP.as_path:
>                 BGP.next_hop: 2001:4878:c225::1:3:2 fe80::1:3:2
>                 BGP.local_pref: 400
>                 BGP.community: (20940,550)
> 
> Thanks,
> Dariusz

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."


More information about the Bird-users mailing list