-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 on non 6pe #15614
Conversation
Isn't this the same technically as #15611? |
4e9a475
to
e6a898a
Compare
I have just updated the commit. In comparison with your fix, I do not send IPv4-mapped IPv6 nexhop if:
I will see what the CI is saying and will do some manual tests to confirm the patch is correct |
Actually, we should take care about RS (route-server) also. Can you check it? |
e6a898a
to
93407c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more elegant solution would be adding a separate flag and avoiding lots of checks (as now). For instance, doing something in bpacket_attr_vec_arr_set_vec()
, like BPKT_ATTRVEC_FLAGS_NO_IPV4_MAPPING
or so. Thoughts?
I will try to do that |
93407c0
to
e08b137
Compare
e08b137
to
d1545c7
Compare
d1545c7
to
324a9e6
Compare
324a9e6
to
48794a0
Compare
Please ignore my ignorance, but could we perhaps honour when 'attribute-unchanged next-hop' is set on a peer? We have interoperability problems with different vendors in our network whereby there is no uniform way of stitching the layer 2 fabric together amongst those devices. We subsequently have layer 2 presented to FRR, where some of these could be route reflectors (these would work with the suggestion of not altering the next-hop when using route reflection or route servers, but also some that provide certain other functions. In those cases MBGP exchanges both IPv4 and IPv6 address families over a single session, the next-hop is the PE router that ingested the prefix via eBGP and the IPv6 next-hop is directly reachable from every device in the network. The key point being that the interface that talks IPv4 + MPLS does not hold the IPv6 global address, that's attached to a separate bridge interface, herewith an example:
The other exceptions, listed above, rely on a route-maps setting the next-hop; we however wouldn't know what that should be as the ingress PE sets it's IPv6 global address as that before sending it to RRs which reflect it to other PEs. Replacing the prefix's next hop with the route reflector's IPv4 encoded as IPv6 on iBGP route reflector sessions should IMHO be an option, to either disable or enable that behaviour, depending on the default. |
5ee4f3f
to
5857362
Compare
678fc17
to
baab11f
Compare
baab11f
to
1a626d9
Compare
This reverts commit 0325116. It was causing an issue where a nexthop for IPv6 over an IPv4 session was always rewritten to an IPv4-mapped IPv6 address even when a valid IPv6 global address was existing. Link: FRRouting#15610 Signed-off-by: Louis Scalbert <[email protected]>
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <[email protected]>
Reduce bgp_interface_address_add indentation Signed-off-by: Louis Scalbert <[email protected]>
Log new IPv6 global address in bgp_interface_address_add Signed-off-by: Louis Scalbert <[email protected]>
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 <[email protected]>
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 <[email protected]>
Move common checks outside of the loop. Signed-off-by: Louis Scalbert <[email protected]>
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 <[email protected]>
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 <[email protected]>
Test ipv6 global removal in bgp_nexthop_mp_ipv4_6 Signed-off-by: Louis Scalbert <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
1a626d9
to
f1b8364
Compare
p->u.prefix6 = | ||
pi->attr->mp_nexthop_global; | ||
else | ||
BGP_ATTR_NH_MP_PREFER_GLOBAL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work if we set attribute-unchanged next-hop
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, waiting on @ton31337 's comments
0325116 ("bgpd: fix 6vpe nexthop") enforced sending an IPv4-mapped IPv6 address as nexthop when the BGP session is on IPv4 and address family IPv6. This is not always correct. In some cases, sending an IPv6 global address is valid on an IPv4 session:
IPv4-mapped IPv6 nexthop should be limited to the 6PE /6vPE cases where the prefix is reachable via an IPv4 only MPLS backbone.
Do not replace the global IPv6 address when sending UPDATE if:
Fixes: 0325116 ("bgpd: fix 6vpe nexthop")