Removing Private AS Numbers from the AS Path
Problem
You are using private AS numbers within your AS and want to remove them on advertisements going out to the public Internet.
Solution
Configure the border router to remove private AS numbers:
[edit protocols bgp] aviva@Router3# set group ISP remove-private
Discussion
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 172.0.0.34 inet.0: 164830 destinations, 164838 routes (164829 active, 0 holddown, 1 hidden) Prefix Nexthop MED Lclpref AS path * 172.0.0.0/24 Self 0 64555 65534 I 172.0.0.0/24 *[BGP/170] 00:04:55, MED 0, localpref 100, from 172.0.0.127 AS path: 64555 65534 I > to 172.0.0.11 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 172.0.0.34 inet.0: 164830 destinations, 164838 routes (164829 active, 0 holddown, 1 hidden) Prefix Nexthop MED Lclpref AS path * 172.0.0.0/24 Self 0 65534 I 172.0.0.0/24 *[BGP/170] 00:04:55, MED 0, localpref 100, from 172.0.0.127 AS path: 65534 I > to 172.0.0.11 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.
Категории