Conversation
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
There was a problem hiding this comment.
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.advertiseto the BGP module schema (newbgp_prefix_listtype + 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.advertisebehavior.
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. |
| 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: |
There was a problem hiding this comment.
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).
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: