This document discusses the removal of the private autonomous system numbers in BGP.
There are no specific requirements for this document.
This document is not restricted to specific software and hardware versions.
For more information on document conventions, refer to the Cisco Technical Tips Conventions.
Private autonomous system (AS) numbers which range from 64512 to 65534 are used to conserve globally unique AS numbers. Globally unique AS numbers (1 - 64511) are assigned by InterNIC. These private AS number cannot be leaked to a global Border Gateway Protocol (BGP) table because they are not unique (BGP best path calculation expects unique AS numbers; see BGP Best Path Selection Algorithm for more information on BGP path selection). For this reason, a new feature was added in Cisco IOS® Software release 10.3 and later, which allows the stripping of private AS numbers out of the AS_PATH list before the routes are propagated to a BGP peer.
Generally customer networks and their routing policies are an extension of the respective Internet Service Providers (ISPs). When a customer network is large, the service provider may assign an AS number using a couple of different methods in order to manage the network and routing policies.
One way is by permanently assigning an AS number in the range of 1 to 64511. This is done when a customer network connects to two different ISPs, such as multihoming. This situation mandates that customer network should have a unique AS number so that it can uniquely propagate its BGP routes to a global BGP mesh via two ISPs.
A second way is by assigning a Private AS number in the range of 64512 to 65534. This is done when a customer network connects to a single ISP (either single-homed or dual-homed to the same ISP) and the intention is to conserve the AS numbers. It is not recommended that you use a private AS number if you are planning to connect to multiple ISPs in the future.
When a private AS number is allocated to the customer network, the BGP updates from the customer network to ISP will have the private AS number in its AS_PATH list. When the ISP propagates its network information to the global BGP table (Internet), it should not propagate the AS_PATH with the private AS number of the customer to the Internet. To help the ISP remove the private AS number from its AS_PATH list, use the Cisco IOS remove-private-as command.
To remove the private AS number, use the neighbor x.x.x.x remove-private-as router configuration command.
The neighbor x.x.x.x remove-private-as per-neighbor configuration command forces BGP to drop the private AS numbers. You can configure this command for external BGP neighbors. When the outbound update contains a sequence of private AS numbers, this sequence is dropped.
The following conditions apply:
You can only use this solution with external BGP (eBGP) peers.
If the update has only private AS numbers in the AS_PATH, BGP removes these numbers.
If the AS_PATH includes both private and public AS numbers, BGP doesn't remove the private AS numbers. This situation is considered a configuration error.
If the AS_PATH contains the AS number of the eBGP neighbor, BGP does not remove the private AS number.
If the AS_PATH contains confederations, BGP removes the private AS numbers only if they come after the confederation portion of the AS_PATH.
For an configuration example, refer to Sample Configuration for Removing Private AS Numbers in BGP.