Skip to content

Set 'rr_client' and 'next_hop_self' attributes on BGP neighbor data#2575

Merged
ipspace merged 1 commit intodevfrom
bgp-rr-client
Aug 6, 2025
Merged

Set 'rr_client' and 'next_hop_self' attributes on BGP neighbor data#2575
ipspace merged 1 commit intodevfrom
bgp-rr-client

Conversation

@ipspace
Copy link
Owner

@ipspace ipspace commented Aug 6, 2025

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

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
Copy link
Collaborator

@jbemmel jbemmel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to clarify in a few words how localas_ibgp neighbors are handled

@ipspace ipspace merged commit 5a836e5 into dev Aug 6, 2025
11 checks passed
@ipspace ipspace deleted the bgp-rr-client branch August 6, 2025 14:53
neighbor_data.rr_client = True
node.bgp.neighbors.append(neighbor_data)

if not ibgp_ngb_list:
Copy link
Collaborator

@jbemmel jbemmel Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants