Skip to content

Implement bgp.advertise node attribute#3236

Open
ipspace wants to merge 3 commits intodevfrom
bgp-adv-list
Open

Implement bgp.advertise node attribute#3236
ipspace wants to merge 3 commits intodevfrom
bgp-adv-list

Conversation

@ipspace
Copy link
Owner

@ipspace ipspace commented Mar 23, 2026

The bgp.advertise attribute is used to advertise BGP prefixes from IPv4/IPv6 prefixes already in the IP routing table (as opposed to bgp.originate that adds a static route).

This PR contains:

  • The definition of bgp.advertise attribute -- a list that accepts IPv4 prefixes, IPv6 prefixes, named prefixes (including dual- stack ones) and ipv4/ipv6 dictionaries
  • Modifications in the BGP module to do sanity checks (values in the bgp.advertise list are adjusted in the data validation process)
  • Updated documentation
  • Sample implementation on FRR
  • Updated integration test

The bgp.advertise attribute is used to advertise BGP prefixes from
IPv4/IPv6 prefixes already in the IP routing table (as opposed to
bgp.originate that adds a static route).

This PR contains:

* The definition of bgp.advertise attribute -- a list that accepts
  IPv4 prefixes, IPv6 prefixes, named prefixes (including dual-
  stack ones) and ipv4/ipv6 dictionaries
* Modifications in the BGP module to do sanity checks (values in
  the bgp.advertise list are adjusted in the data validation process)
* Updated documentation
* Sample implementation on FRR
* Updated integration test
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new bgp.advertise node attribute to advertise BGP prefixes that already exist in the IP routing table (as opposed to bgp.originate, which installs a discard static route), along with device-feature gating, documentation updates, and an integration test.

Changes:

  • Add bgp.advertise to the BGP module schema (new bgp_prefix_list type + node attribute).
  • Add a device capability check in the BGP module and mark FRR as supporting bgp.advertise.
  • Update BGP documentation and extend the existing integration test to validate bgp.advertise behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/integration/bgp/04-originate.yml Extends integration coverage to validate advertising an IGP-learned prefix via bgp.advertise, with feature-based test adjustment.
netsim/modules/bgp.yml Adds a new list datatype and exposes bgp.advertise as a node attribute in the BGP module schema.
netsim/modules/bgp.py Adds a post-transform capability check that warns when bgp.advertise is used on devices lacking support.
netsim/devices/frr.yml Declares FRR support for the new bgp.advertise feature flag.
docs/module/bgp.md Documents bgp.advertise and clarifies the difference vs. bgp.originate, plus VRF/link/interface references.

Comment on lines 83 to 92
node:
as:
type: asn
_required: True
next_hop_self: { copy: global }
rr: bool
rr_cluster_id: { copy: global }
rr_mesh: { copy: global }
advertise: bgp_prefix_list
originate:
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The schema adds bgp.advertise as a node attribute, but there is no corresponding attributes.vrf.advertise; that means nodes.<n>.vrfs.<v>.bgp.advertise (mentioned in the docs and handled by rp_data(..., 'bgp')) will fail attribute validation. Add advertise: bgp_prefix_list under the vrf: section (or adjust the docs if VRF-level advertise is intentionally unsupported).

Copilot uses AI. Check for mistakes.
@ipspace ipspace requested a review from jbemmel March 23, 2026 18:05
ipspace added a commit that referenced this pull request Mar 23, 2026
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