Conversation
|
This is an attempt to solve #2615. I will push several iterations because it's easier to review changes to transformation tests on GH web interface. Once the whole thing is done, I'll mark it ready for review. |
| # These attributes will be used to populate neighbor's "neighbor" list in VLANs | ||
| # with mode = route. We have to fix the IRB neighbors when rebuilding neighbor list. | ||
| # | ||
| data.merge_with_removed_attributes(intf,vdata,topology.nodes[intf.node].get('module',[])) |
There was a problem hiding this comment.
The only significant impact of this change is in the stp.yml results where the VLAN STP priority is applied to a VLAN access port. I would claim this is the correct behavior anyway.
In all other changes to transformation test results, the VLAN data is applied to link interfaces entry, which is expected, and there are no further changes.
87d0a4c to
de21d94
Compare
| # The current node data must be based on physical interfaces | ||
| # Remove the current node from the neighbor list and add the SVI information | ||
| # | ||
| vlan_data.neighbors = [ n for n in vlan_data.neighbors if n.node != node.name ] + [ svi_ifdata ] |
There was a problem hiding this comment.
Impact of this change: potentially rearranged list of VLAN neighbors, which might trigger a change in the default gateway (because a different router becomes the first neighbor) and a related change in the static routes on attached hosts.
| vlan_data.neighbors.append(n_data) # Add current node as a neighbor to VLAN neighbor list | ||
| # The current node is not yet in the VLAN neighbor list, add the SVI information | ||
| # | ||
| vlan_data.neighbors.append(svi_ifdata) |
There was a problem hiding this comment.
Impact of this change: module data from SVI interface is added to the VLAN (and subsequently interface) neighbor list
|
|
||
| # Try to get the gateway-of-last-resort from the fake "interface" neighbors | ||
| # | ||
| (gw_data,_) = routing.create_gateway_last_resort(ifdata,data.get_box({'ipv4': True}),topology) |
There was a problem hiding this comment.
Impact of this change: the DHCP state of link- or VLAN-level neighbors is aligned with the final interface DHCP state, removing the impact of copying SVI interface module attributes to the VLAN neighbor list.
|
As expected, these changes resulted in massive changes in transformation test results. I went through all of those, and they all looked legit to me. I also documented the impact of individual changes to the test results to help you understand what's going on. The whole thing should now be working the way I expect it should work (how's that for a definitive statement 😜). It solves the BGP local_as problem and the "correct" VLAN neighbor data might help us solve a few others (for example, some reports and graphs struggled with VLANs). |
* Copy node VLAN data to interface data during link_pre_transform to have them available when the neighbor list is built during link transformation * Copy most of the SVI interface data to the neighbor data structure when recreating the VLAN-wide neighbor list Also: * Fix the DHCP attributes in the neighbor data to reflect the final state of the device interfaces. This allows the 'get gw of last resort' function to return the actual default gateway * Add an optional 'limit merge to these attributes' parameter to the 'data.merge_with_removed_attributes' utility function * An IRB VLAN was added to the 'bgp-ibgp-localas' integration test as a regression test for #2615 Fixes #2615
Add module data to VLAN neighbors
have them available when the neighbor list is built during link
transformation
when recreating the VLAN-wide neighbor list
Also:
state of the device interfaces. This allows the 'get gw of last
resort' function to return the actual default gateway
'data.merge_with_removed_attributes' utility function
as a regression test for [BUG] bgp.local_as not working with VLAN #2615
Fixes #2615