You are using private AS numbers within your AS and want to remove them on advertisements going out to the public Internet.
Configure the border router to remove private AS numbers:
[edit protocols bgp] aviva@Router3# set group ISP remove-private
When BGP advertises prefixes to remote systems, it includes the AS_PATH attribute, which lists all the ASs along the path to the prefix. BGP routers use this information to determine the path to the routes origin. As a route passes through each AS, the BGP router adds its AS number to the beginning of the AS path. In this way, each AS is a single hop in the path. The BGP specification prohibits removing information from the AS path attribute. However, if on your internal network you are using private AS numbers (numbers in the range from 64512 tHRough 65534), you shouldn be passing these numbers to the Internet because they are reserved for private use only. If another network happens to be using the same private AS numbers, the two ASs will not be able communicate with each other because BGP will see the same AS numbers and conclude that there is a routing loop.
Use the set remove-private command to remove private AS numbers when the local border router advertises its prefixes to remote border routers. One case when you might want to do this is if your customers are using private AS numbers within the networks and, as the ISP, you want to remove the private AS numbers from the path. You include this configuration in the EBGP group that faces the Internet or other EBGP peers.
Looking in the routing table of the receiving router before the remove-private configuration, you see that the routes contain private AS numbers. The following route contains the private number 64555:
aviva@Router3> show route advertising-protocol bgp 18.104.22.168 inet.0: 164830 destinations, 164838 routes (164829 active, 0 holddown, 1 hidden) Prefix Nexthop MED Lclpref AS path * 22.214.171.124/24 Self 0 64555 65534 I 126.96.36.199/24 *[BGP/170] 00:04:55, MED 0, localpref 100, from 188.8.131.52 AS path: 64555 65534 I > to 184.108.40.206 via ge-1/3/0.2
After the configuration is applied, BGP strips the private AS number from the AS path, and the receiving router no longer sees it in the routing table:
aviva@Router3> show route advertising-protocol bgp 220.127.116.11 inet.0: 164830 destinations, 164838 routes (164829 active, 0 holddown, 1 hidden) Prefix Nexthop MED Lclpref AS path * 18.104.22.168/24 Self 0 65534 I 22.214.171.124/24 *[BGP/170] 00:04:55, MED 0, localpref 100, from 126.96.36.199 AS path: 65534 I > to 188.8.131.52 via ge-1/3/0.2
The remove-private statement removes only leading private AS numbers. If the path had been 3937 64555, the private AS would remain in the path. As another example, the path 64555 64555 64555 65300 64590 65534 would be sent as local-AS 65300 64590 65534.
Router Configuration and File Management
Basic Router Security and Access Control
Routing Policy and Firewall Filters