The AS_PATH attribute provides the list of Autonomous Systems through which the routing information has passed. The AS_PATH attribute is composed of segments. There can be up to 4 different types of segments in an AS_PATH attribute: AS_SET, AS_SEQUENCE, AS_CONFED_SET and AS_CONFED_SEQUENCE. The AS_SET and AS_CONFED_SET segment types result from route aggregation. AS_CONFED_SEQUENCE contains an ordered list of member AS through which the route has passed inside a confederation. AS_SEQUENCE contains an ordered list of AS (including confederation IDs) through which the route has passed on its way to the local AS/confederation.
The AS numbers in the AS_PATH attribute are all 2-byte values or all 4-byte values (if the 4-octet ASN capability was announced by both peers).
A BGP router always prepends its AS number to the AS_PATH attribute when advertising a route to an EBGP peer. The specific details for a 7450, 7750, or 7950 router are described below.
When a route is advertised to an EBGP peer and the advertising router is not part of a confederation.
The global AS (configured using the autonomous-system command) is prepended to the AS_PATH if local-as is not configured.
The local AS followed by the global AS are prepended to the AS_PATH if local-as is configured.
Only the local AS is prepended to the AS_PATH if local-as no-prepend-global-as is configured.
Some or all private and reserved AS numbers (64512 to 65535 and 4200000000 to 4294967295 inclusive) can be removed or replaced from the AS_PATH if the remove-private command is configured.
When a route is advertised to an EBGP peer outside a confederation.
The confederation ID is prepended to the AS_PATH if local-as is not configured.
The local AS followed by the confederation ID are prepended to the AS_PATH if local-as is configured (the no-prepend-global-as option has no effect in this scenario).
Member AS numbers are removed from the AS_PATH as described in the section titled BGP confederations.
Some or all private and reserved AS numbers (64512 to 65535 and 4200000000 to 4294967295 inclusive) can be removed or replaced from the AS_PATH if the remove-private command is configured.
When a route is advertised to a confederation-EBGP peer.
If the route came from an EBGP peer and local-as was configured on this session (without the private option) this local AS number is prepended to the AS_PATH in a regular AS_SEQUENCE segment.
The global AS (configured using the autonomous-system command) is prepended, as a member AS, to the AS_PATH if local-as is not configured.
The local AS followed by the global AS are prepended, as member AS, to the AS_PATH if local-as is configured.
Only the local AS is prepended, as a member AS, to the AS_PATH if local-as no-prepend-global-as is configured.
Some or all private and reserved AS numbers (64512 to 65535 and 4200000000 to 4294967295 inclusive) can be removed or replaced from the AS_PATH if the remove-private command is configured.
When a route is advertised to an IBGP peer.
No information is added to the AS_PATH if the route is locally originated or if it came from an IBGP peer.
The local AS number is prepended to the AS_PATH if the route came from an EBGP peer and local-as is configured without the private option.
The local AS number is prepended, as a member AS, to the AS_PATH if the route came from a confederation-EBGP peer and local-as is configured without the private option.
Some or all private and reserved AS numbers (64512 to 65535 and 4200000000 to 4294967295 inclusive) can be removed or replaced from the AS_PATH if the remove-private command is configured.
BGP import policies can be used to prepend an AS number multiple times to the AS_PATH, whether the route is received from an IBGP, EBGP or confederation EBGP peer. The AS path prepend action is also supported in BGP export policies applied to these types of peers, regardless of whether the route is locally originated or not. AS path prepending in export policies occurs before the global and/or local ASes (if applicable) are added to the AS_PATH.
When a BGP router receives a route containing one of its own autonomous system numbers (local or global or confederation ID) in the AS_PATH the route is normally considered invalid for reason of an AS path loop. However, SR OS provides a loop-detect command that allows this check to be bypassed. If it known that advertising specific routes to an EBGP peer results in an AS path loop condition and yet there is no loop (assured by other mechanisms, such as the Site of Origin (SOO) extended community), then as-override can be configured on the advertising router instead of disabling loop detection on the receiving router. The as-override command replaces all occurrences of the peer AS in the AS_PATH with the advertising router’s local AS.