External BGP requires that globally unique AS numbers be used when routing to the global Internet. Using private AS numbers (64512 to 65535) would prevent access to the global Internet. This feature allows routers that belong to a private AS to access the global Internet. A network administrator configures the routers to remove private AS numbers from the AS path contained in outgoing update messages and optionally, to replace those numbers with the ASN of the local router, so that the AS Path length remains unchanged.
The replace-as keyword is available to replace the private AS numbers being removed from the path with the local AS number, thereby retaining the same AS path length.
This example removes all the private AS numbers from the AS path in outgoing eBGP updates and replaces them with the public AS number of the local router.