Set 'rr_client' and 'next_hop_self' attributes on BGP neighbor data#2575
Merged
Set 'rr_client' and 'next_hop_self' attributes on BGP neighbor data#2575
Conversation
The BGP neighbor 'rr_client' and 'next_hop_self' attributes will make the configuration templates much cleaner as we'll avoid all the crazy logic that is repeated in every template. Note that the existing attributes are not changed, so there's no rush to migrate the templates to the new attributes. That can be done at any time we feel like cleaning them up. Also: refactor and cleanup the IBGP session generation logic to avoid duplicate code
jbemmel
reviewed
Aug 6, 2025
jbemmel
approved these changes
Aug 6, 2025
Collaborator
jbemmel
left a comment
There was a problem hiding this comment.
Would be good to clarify in a few words how localas_ibgp neighbors are handled
jbemmel
reviewed
Aug 8, 2025
| neighbor_data.rr_client = True | ||
| node.bgp.neighbors.append(neighbor_data) | ||
|
|
||
| if not ibgp_ngb_list: |
Collaborator
There was a problem hiding this comment.
This change leads to a warning about missing IGP even though the topology specifies bgp.sessions.ipv4: [ ebgp ] to exclude any IBGP sessions
The difference seems to be that the has_ibgp flag wouldn't get set in that case, but the new ibgp_ngb_list contains nodes even though the bgp.sessions parameter says those sessions shouldn't get built
ipspace
added a commit
that referenced
this pull request
Aug 8, 2025
ipspace
added a commit
that referenced
this pull request
Aug 9, 2025
ipspace
added a commit
that referenced
this pull request
Aug 9, 2025
* We need 'next-hop-self' on confederation EBGP sessions * Some templates (for example, Arista EOS) are easier to write if the 'next_hop_self' attribute has text values: 'ebgp' to change NH only on EBGP routes and 'all' to change NH on all routes (including reflected IBGP routes)
ipspace
added a commit
that referenced
this pull request
Aug 9, 2025
ipspace
added a commit
that referenced
this pull request
Aug 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The BGP neighbor 'rr_client' and 'next_hop_self' attributes will make the configuration templates much cleaner as we'll avoid all the crazy logic that is repeated in every template.
Note that the existing attributes are not changed, so there's no rush to migrate the templates to the new attributes. That can be done at any time we feel like cleaning them up.
Also: refactor and cleanup the IBGP session generation logic to avoid duplicate code