BGP Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Release

PDF

Private AS number removal in iBGP advertisements

Want to summarize with AI?

Log in

Overview

Explains the functionality of removing private AS numbers from iBGP advertisements only when it is safe to do so, helping prevent routing loops and supporting scenarios where eBGP boundary removal is not sufficient.

The removing private AS numbers when advertising to iBGP neighbors is a routing feature that:

  • provides a safe method to remove private AS numbers when advertising to iBGP neighbors without causing routing loops,

  • enables safe AS_PATH modification for iBGP neighbors by removing private AS numbers only if all AS numbers in the path are private, and

  • addresses specific network scenarios where traditional inbound removal at the eBGP boundary is insufficient.

The remove-private-as internal command allows you to configure this behavior under the neighbor address-family.

This feature ensures that private AS numbers are stripped from iBGP advertisements only when it is safe to do so, preventing routing loops that can occur if AS_PATH modifications are done improperly.

Unlike general AS_PATH modifications, which are disallowed for iBGP neighbors, this targeted removal provides a controlled exception to meet operational needs.

Use this feature when you need to advertise routes to internal BGP neighbors without private AS numbers in the AS_PATH, especially in complex network topologies where eBGP boundary removal is not enough.


Limitations and usage guidelines for removing private AS numbers when advertising to iBGP neighbors

To ensure safe and effective use of the remove-private-AS internal feature when advertising routes to iBGP neighbors, follow these principles:

  • Configure the remove-private-as internal command only when you need to strip private AS numbers in iBGP advertisements.

  • Do not configure this command under BGP Route Policy Language (RPL), as no changes have been made to support stripping private AS numbers via policies.

  • Avoid using this feature with attribute sets (attrset), as it is not supported.

  • Do not use this feature with BGP confederations, especially confederation iBGP, as it is not supported.

  • Do not combine this feature with the ibgp-local-as feature.

  • Avoid using this feature with graceful shutdown prepends, as it is not supported.

Adhering to these guidelines helps prevent routing issues and ensures network stability when modifying AS_PATH attributes for iBGP neighbors.


Configure private AS number removal when advertising to iBGP neighbors

To safely remove private Autonomous System Numbers (ASNs) from the AS_PATH attribute when advertising routes to internal BGP (iBGP) neighbors.

Procedure

1.

Create an address-family group and enable private AS number removal.

Example:

Router(config)# router bgp 140
Router(config-bgp)# af-group group1 address-family ipv4 unicast
Router(config-bgp-afgrp)# remove-private-as
Router(config-bgp-afgrp)# exit
2.

Configure the iBGP nieghbor.

Example:

Router(config)# router bgp 140
Router(config-bgp)# neighbor 172.20.1.1
Router(config-bgp-nbr)# remote-as 140
Router(config-bgp-nbr)# address-family ipv4 unicast
Router(config-bgp-nbr-af)# use af-group group1
Router(config-bgp-nbr-af)# remove-private-as internal