Configuring AS Numbers for BGP
An autonomous system (AS) is a set of routing devices that are under a single technical administration and that generally use a single interior gateway protocol (IGP) and metrics to propagate routing information within the set of routing devices. An AS appears to other ASs to have a single, coherent interior routing plan and presents a consistent picture of what destinations are reachable through it.
ASs are identified by a number that is assigned by the Network Information Center (NIC) in the United States (http://www.isi.edu). In Junos OS Release 9.1 and later, you can configure a number from 1 through 4,294,967,295 in plain-number format. The range is extended to provide BGP support for 4-byte AS numbers, as defined in RFC 4893, BGP Support for Four-octet AS Number Space. All releases of the Junos OS support 2-byte AS numbers. The 2-byte AS number range is 1 through 65,535 in plain-number format (this is a subset of the 4-byte range).
RFC 4893 introduces two new optional transitive BGP attributes, AS4_PATH and AS4_AGGREGATOR. These new attributes are used to propagate 4-byte AS path information across BGP speakers that do not support 4-byte AS numbers. RFC 4893 also introduces a reserved, well-known, 2-byte AS number, AS 23456. This reserved AS number is called AS_TRANS in RFC 4893.
In Junos OS Release 9.3 and later, you can also configure a 4-byte AS number using the AS-dot notation format of two integer values joined by a period: <16-bit high-order value in decimal>.<16-bit low-order value in decimal>. For example, the 4-byte AS number of 65,546 in plain-number format is represented as 1.10 in the AS-dot notation format. In AS-dot notation format, you can specify a value for AS number from 0.0 through 65535.65535.
If you are using BGP on the routing device, you must configure an AS number.
To configure the routing device’s AS number, include the autonomous-system statement:
For a list of hierarchy levels at which you can include this statement, see the statement summary section for this statement.
To specify the maximum number of times that this AS number can appear in an AS path, include the loops option. You can specify a value in the range from 1 through 10. The default value is 1.
The AS path attribute is modified when a route is advertised to an EBGP peer. Each time a route is advertised to an EBGP peer, the local routing device prepends its AS number to the existing path attribute, and a value of 1 is added to the AS number. The default loop value of 1 means that an AS number can appear in an AS path only one time. That is, when the local routing device advertises an AS path to an EBGP peer, that peer cannot advertise that AS path to another EBGP peer. To ensure that the AS path can be advertised by the peer that receives the route to another EBGP peer, specify a loops value of 2.
![]() | Note: When you specify the same AS number in more than one routing instance on the local routing device, you must configure the same number of loops for the AS number in each instance. For example, if you configure a value of 3 for the loops statement in a VPN routing and forwarding (VRF) routing instance that uses the same AS number as that of the master instance, you must also configure a value of 3 loops for the AS number in the master instance. Use the independent-domain option if the loops statement must be enabled only on a subset of routing instances. For more information about configuring an independent AS domain, see Configuring Independent AS Domains. |
By default, the AS number is displayed in plain-number format even if you configured a 4-byte AS number using the AS-dot notation format. Include the asdot-notation statement to configure the router to display a 4-byte AS number in the AS-dot notation format.
Examples: Configuring AS Numbers
Configure the 4-byte AS number 65,546 represented in plain-number format:
Configure the 4-byte AS number 65,546 represented in AS-dot notation format (in this example, 1.10 is the AS-dot notation format for 65,546):
Configure the 2-byte AS number 60,000 represented in plain-number format:
Related Topics
- 4-Byte Autonomous System Numbers Overview in the Using 4-Byte Autonomous System Numbers in BGP Networks Technology Overview
- Juniper Networks Implementation of 4-Byte Autonomous System Numbers in the Using 4-Byte Autonomous System Numbers in BGP Networks Technology Overview
- Configuring 4-Byte Autonomous System Numbers in the Using 4-Byte Autonomous System Numbers in BGP Networks Technology Overview
- Understanding a 4-Byte Capable Router AS Path Through a 2-Byte Capable Domain in the Using 4-Byte Autonomous System Numbers in BGP Networks Technology Overview

