The BGP private-as numbers range from 64512 65535. Because they are private, it means they are not globally unique. This means that ISPs need to ensure they strip private-as numbers off BGP updates to eBGP peers when announcing routing information across the internet. One way to do that is by using the remove-private-as command.
In the network below, the customer is using the private as number 64512. We are going to configure the router at the ISP so that it does not advertise the customers AS number out to the internet. This means that all his prefixes will appear as though they came directly from the ISP. Technically the ISP usually owns the customers prefixes anyway (when he is using a private-as).
To start, we will check R3s BGP table.
R3#sh ip bgp
BGP table version is 2, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
r> 23.23.23.0/30 23.23.23.1 0 0 1 i
*> 100.100.100.1/32 23.23.23.1 0 1 64512 i
Currently, the output shows R3 is receiving the 100.100.100.1/32 prefix from the ISP, but the customers AS has also been included in the AS_PATH. Lets adjust that now.
R2(config-router)#router bgp 1
R2(config-router)#neighbor 23.23.23.2 remove-private-as
R2(config-router)#end
R2#clear ip bgp * out
R3#sh ip bgp
BGP table version is 7, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incomplete
Network Next Hop Metric LocPrf Weight Path
r> 23.23.23.0/30 23.23.23.1 0 0 1 i
*> 100.100.100.1/32 23.23.23.1 0 1 i
And there we have it. The customers AS has been removed.