-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd: fix ipv4-mapped ipv6 use cases #17019
base: master
Are you sure you want to change the base?
Commits on Oct 7, 2024
-
topotests: add an ebgp 6vpe test
This test uses the connected ipv4 mapped ipv6 prefix to resolve the received BGP routes. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> Signed-off-by: François Dumontet <francois.dumontet@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for e78b216 - Browse repository at this point
Copy the full SHA e78b216View commit details -
bgpd: optimize bgp_interface_address_add
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for c5ea446 - Browse repository at this point
Copy the full SHA c5ea446View commit details -
bgpd: reduce bgp_interface_address_add indentation
Reduce bgp_interface_address_add indentation Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 9f29bf8 - Browse repository at this point
Copy the full SHA 9f29bf8View commit details -
bgpd: log new ipv6 global in bgp_interface_address_add
Log new IPv6 global address in bgp_interface_address_add Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for a6a9322 - Browse repository at this point
Copy the full SHA a6a9322View commit details -
bgpd: fix sending ipv6 local nexthop if global present
bgpd keeps on advertising IPv6 prefixes with a IPv6 link-local nexthop after a valid IPv6 global appears. At bgpd startup, the IPv6 global is announced by zebra after the link-local. Only the link-local is advertised. Clearing the BGP sessions make the global to to be announced. Update the nexthops with the global IPv6 when available. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 3b84b32 - Browse repository at this point
Copy the full SHA 3b84b32View commit details -
topotests: add bgp_nexthop_mp_ipv4_6 test
Add bgp_nexthop_mp_ipv4_6 topotest to test to nexhop value with MP-BGP IPv4 and IPv6 on IPv4 peering. The test has route-reflector, route-server, iBGP and eBGP peers. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 5b3c646 - Browse repository at this point
Copy the full SHA 5b3c646View commit details -
bgpd: optimize bgp_interface_address_del
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 76b121d - Browse repository at this point
Copy the full SHA 76b121dView commit details -
bgpd: fix removing ipv6 global nexhop
When the IPv6 global is removed on an interface towards a peer, the IPv6 nexthop global that is sent is a IPv4-mapped IPv6 address. It should be the link-local. At removal, replace the global by the next global address or the link-local as last resort. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 6cc1a5d - Browse repository at this point
Copy the full SHA 6cc1a5dView commit details -
bgpd: fix "used" json key on link-local nexthop
When a peer has no IPv6 global address to send as nexthop, it sends the IPv6 link-local instead as global. "show bgp ipv6 json" displays the same address in global and link-local scopes. > "nexthops": [ > { > "ip": "fe80::a495:38ff:fea6:6ea3", > "afi": "ipv6", > "scope": "global", > "used": true > }, > { > "ip": "fe80::a495:38ff:fea6:6ea3", > "afi": "ipv6", > "scope": "link-local" > } > ] However, "used" key is set on the global nexthop but not in link-local. It is correct but it makes difficult to test JSON to expect the usage of a link-local. The contrary is also correct. Set "used" key on the link-local nexhop instead to facilitate the tests. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 771c98a - Browse repository at this point
Copy the full SHA 771c98aView commit details -
tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6
Test ipv6 global removal in bgp_nexthop_mp_ipv4_6 Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for baaced7 - Browse repository at this point
Copy the full SHA baaced7View commit details -
bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop
The code was expected that no IPv6 global address was present but the previous commit was replacing nexthop.v6global by the link-local address instead of un-setting it in case of removal of the IPv6 global. Set also ipv4-mapped ipv6 address as nexthop when a link-local is found and it is an ipv4 prefix over ipv6 nexthop. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for ce2b15c - Browse repository at this point
Copy the full SHA ce2b15cView commit details -
bgpd: prefer link-local to a ipv4-mapped ipv6 global
When a peer sends an IPv4-mapped IPv6 global and a IPv6 link-local nexthop, prefer the link-local unless a route-map tells to use the global. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 975af27 - Browse repository at this point
Copy the full SHA 975af27View commit details -
topotests: update bgp_vrf_leaking_5549_routes
Before the patch-set, ce1 was sending an IPv6 Link-local as global and link-local nexthop to pe1. Set bgp_vrf_leaking_5549_routes in accordance with the previous fixes. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for f3c825d - Browse repository at this point
Copy the full SHA f3c825dView commit details -
bgpd: fix ipv4-mapped ipv6 for ipv6 over ipv4 peer
When IPv6 prefixes are sent over an IPv4 session, the UPDATE is sent with a link-local nexthop as global nexthop instead of a IPv4-mapped IPv6 address. If the peer interface has no IPv6 address, routes are not installed. Seen with bgp_nexthop_mp_ipv4_6 topotests on step2: > root@r2:/# vtysh -c 'show bgp ipv6 fd00:100::/64 json' | jq . > { > "prefix": "fd00:100::/64", > "paths": [ > { > "nexthops": [ > { > "ip": "fe80::449a:f8ff:fe67:1f93", > "hostname": "r1", > "afi": "ipv6", > "scope": "global", > "metric": 0, > "accessible": true > }, > { > "ip": "fe80::449a:f8ff:fe67:1f93", > "hostname": "r1", > "afi": "ipv6", > "scope": "link-local", > "accessible": true, > "used": true > } > ], > } > ] > } Now: > root@r2:/# vtysh -c 'show bgp ipv6 fd00:100::/64 json' | jq . > { > "prefix": "fd00:100::/64", > "paths": [ > "nexthops": [ > { > "ip": "::ffff:172.16.0.1", > "hostname": "r1", > "afi": "ipv6", > "scope": "global", > "metric": 0, > "accessible": true > }, > { > "ip": "fe80::3842:28ff:fe90:f815", > "hostname": "r1", > "afi": "ipv6", > "scope": "link-local", > "accessible": true, > "used": true > } > ], > } > ] > } Note that the link-local is still preferred over the global address. Fixes: 25995695f5 ("bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 43cf690 - Browse repository at this point
Copy the full SHA 43cf690View commit details -
bgpd: fix nexthop resolution of ipv4-mapped ipv6
Fix nexthop resolution of ipv4-mapped ipv6 nexthop addresses. Fixes: 5dd731a ("bgpd: prefer link-local to a ipv4-mapped ipv6 global") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for ff37609 - Browse repository at this point
Copy the full SHA ff37609View commit details -
bgpd: replace ipv4-mapped ipv6 at update forwarding
Replace IPv4-mapped IPv6 at update forwarding because the peer may not be able to create a route with the IPv4-mapped IPv6. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for 929a070 - Browse repository at this point
Copy the full SHA 929a070View commit details -
topotests: bgp_nexthop_mp_ipv4_6, test ipv4-mapped
Test that a IPv4-mapped IPv6 is sent from a peer that has no global IPv6 address. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Configuration menu - View commit details
-
Copy full SHA for bd8f81a - Browse repository at this point
Copy the full SHA bd8f81aView commit details -
bgpd: Do not use mapped IPv4/IPv6 addresses for unnumbered peering
Before: ``` router bgp 4283023031 bgp router-id 100.83.23.31 neighbor leafs peer-group neighbor leafs remote-as external neighbor eth1 interface peer-group leafs ! address-family ipv4 unicast network 100.83.23.31/32 exit-address-family ! exit ``` ``` leaf2# show ip bgp 100.83.23.31/32 … 4283023031 ::ffff:6453:171f (inaccessible) from node31-h23-osl3(swp32) (100.83.23.31) (fe80::a6bf:1ff:fe2d:689a) (used) Origin IGP, metric 0, invalid, external Last update: Tue Aug 13 08:36:46 2024 ``` Fixes: fc5a738 ("bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Configuration menu - View commit details
-
Copy full SHA for 4b983b5 - Browse repository at this point
Copy the full SHA 4b983b5View commit details