Skip to content

Check device support for bgp.remove_private_as values#3463

Merged
ipspace merged 2 commits into
devfrom
bgp-remove-private-as
Jun 8, 2026
Merged

Check device support for bgp.remove_private_as values#3463
ipspace merged 2 commits into
devfrom
bgp-remove-private-as

Conversation

@ipspace

@ipspace ipspace commented Jun 8, 2026

Copy link
Copy Markdown
Owner

The 'check_device_attribute_support' function has been enhanced to check for the values of an enabled feature when that feature flag is a dictionary with 'valid' attribute. All other behavior is unchanged.

This addition is used to check for valid values of the bgp.remove_private_as attribute on common platforms (EOS, FRR, IOS, IOS XR, Junos).

Other changes:

  • Enhanced IOS XR support
  • The attribute value must be set in bgp.session plugin before the device support is checked (to give that function a value to check)

Incidentally fixes #3165

The 'check_device_attribute_support' function has been enhanced to
check for the values of an enabled feature when that feature flag
is a dictionary with 'valid' attribute. All other behavior is
unchanged.

This addition is used to check for valid values of the
bgp.remove_private_as attribute on common platforms (EOS, FRR, IOS,
IOS XR, Junos).

Other changes:
* Enhanced IOS XR support
* The attribute value must be set in bgp.session plugin before the
  device support is checked (to give that function a value to check)

Incidentally fixes #3165

Copilot AI left a comment

Copy link
Copy Markdown

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 extends BGP device capability checks so platforms can declare supported values (not just on/off support) for specific BGP neighbor attributes, and uses that mechanism to validate per-platform values for bgp.remove_private_as (fixing #3165).

Changes:

  • Enhanced check_device_attribute_support() to validate neighbor attribute values when the device feature flag is a dict containing a valid list.
  • Updated bgp.session to set the neighbor attribute value before running device-support checks (so value validation has input).
  • Added/updated platform support for remove_private_as values (notably IOS XR) and introduced an errors test to verify failures on unsupported values.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/errors/bgp-remove-private-as.yml New error-topology test covering device-specific remove_private_as value validation
tests/errors/bgp-remove-private-as.log Expected error output for unsupported remove_private_as values
netsim/utils/routing.py Enhanced device attribute support check to validate dict-based valid values
netsim/extra/bgp.session/plugin.py Ensures neighbor attribute is set before capability/value check
netsim/extra/bgp.session/iosxr.j2 Expanded IOS XR rendering for various remove-private-AS modes
netsim/devices/xr.yml Declares IOS XR-supported remove_private_as values via .valid
netsim/devices/junos.yml Declares Junos-supported remove_private_as values via .valid
netsim/devices/ios.yml Declares IOS-supported remove_private_as values via .valid
netsim/devices/frr.yml Declares FRR-supported remove_private_as values via .valid
netsim/devices/eos.yml Declares EOS-supported remove_private_as values via .valid

Comment thread netsim/utils/routing.py Outdated
@ipspace ipspace merged commit 5a71699 into dev Jun 8, 2026
13 checks passed
@ipspace ipspace deleted the bgp-remove-private-as branch June 8, 2026 15:58
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.

[BUG] Implement inbound remove-private-AS and replace-private AS on IOS/XR

2 participants