Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

local-as

Syntax

Hierarchy Level

Description

Specify the BGP local autonomous system (AS) number for a BGP neighbors. This local AS may differ from the global AS configured under the routing-options autonomous system statement.

An AS is a set of routing devices that are under a single technical administration and generally use a single interior gateway protocol (IGP) and metrics to propagate routing information within the set of routing devices.

Internet service providers (ISPs) sometimes acquire networks that belong to a different AS. When this occurs, there is no seamless method for moving the BGP peers of the acquired network to the AS of the acquiring ISP. The process of configuring the BGP peers with the new AS number can be time-consuming and cumbersome. In this case, it might not be desirable to modify peer arrangements or configuration. During this kind of transition period, it can be useful to configure BGP-enabled devices in these ASes to peer with each other using an AS that is different than the locally configured global AS. This is called AS masquerading.

When configured to perform AS masquerading using the local-as feature, the contents of the BGP AS_PATH in BGP updates may differ from simple eBGP peering and will depend on the options configured with local-as.

Important:

When using BGP on a routing device, you should first configure the global AS number under the routing-options autonomous-system statement before specifying the local AS number. Certain BGP features utilize this global AS number, even when the BGP peering sessions are able to determine their local AS number solely from local-as configuration.

If the local AS for the EBGP or IBGP peer is the same as the current AS, do not use the local-as statement to specify the local AS number.

In Junos OS Release 9.1 and later, the AS numeric range in plain-number format is extended to provide BGP support for 4-byte AS numbers, as defined in RFC 4893, BGP Support for Four-octet AS Number Space.

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 65546 in plain-number format is represented as 1.10 in the AS-dot notation format. For more information, see autonomous-system and BGP 4-Byte AS Numbers.

Note:

The auto route target feature does not support the local AS number for BGP neighbors associated with the Ethernet Virtual Private Network Instance (EVI).

The route target filtering feature does not support the local AS numbers for BGP neighbors associated with RT-Constrain routes.

Link-State Distribution Using BGP does not support the local AS numbers when generating Node descriptor TLVs.

Options

alias

(Optional) Configure the local AS as an alias of the global AS number configured for the router under [edit routing-options] autonomous-system. As a result, a BGP peer considers any local AS to which it is assigned as equivalent to the primary AS number configured for the routing device.

The alias option enables the router to establish BGP sessions using either the global AS or the local AS. This feature facilitates AS number renumbering transitions by allowing the router to attempt peering with its neighbor via both AS numbers.

When the alias option is enabled, the router initially uses the global AS from routing-options autonomous-system in its OPEN message to the BGP neighbor.

Upon receiving a NOTIFICATION message for OPEN messages from that neighbor, the router then uses the configured local-as autonomous-system number.

When you use the alias option, only the AS (global or local) used to establish the BGP session is prepended in the AS path sent to the BGP neighbor.

For loop detection purposes, the local-as autonomous-system, is considered equivalent to the global AS.

Note:

The private and alias options are mutually exclusive. You cannot configure both options with the same local-as statement.

The alias option is not supported for features that permit unconfigured dynamic peering sessions, including the allow statement and the dynamic-neighbor hierarchy.

The local-as alias option does not work with the BGP allow statement. If both these options are configured and if you cannot establish a BGP session, you can delete the alias option to restore the BGP session.

autonomous-system

AS number.

  • Range: 1 through 4,294,967,295 (232 – 1) in plain-number format

  • Range: 0.0 through 65535.65535 in AS-dot notation format

The autonomous-system number is the AS number that the router includes in its BGP OPEN messages.

Also, to understand how the alias option can impact the AS number used in BGP OPEN messages, see the alias option.

loops number

(Optional) Specify the number of times detection of the AS number in the AS_PATH attribute causes the route to be discarded or hidden. For example, if you configure loops 1, the route is hidden if the AS number is detected in the path one or more times. This is the default behavior. If you configure loops 2, the route is hidden if the AS number is detected in the path two or more times.

The behavior of this statement is slightly different from the loops (BGP Address Family) statement.

The global AS loop detection behavior can be configured using the loops statement under [edit routing-options autonomous-system].

Note:

If you configure the local AS values for any BGP group, the detection of routing loops is performed using both the global AS and the local AS values for all BGP groups in the AS domain.

When you configure the local AS within a VRF, this impacts the AS path loop-detection mechanism. All of the local-as statements configured on the device are part of a single AS domain. The AS path loop-detection mechanism is based on looking for a matching AS present in the domain.

  • Range: 1 through 10

  • Default: 1

Note:

For loop detection purposes, different routing-instances can be placed in separate AS domains by configuring the independent-domain statement. For more details, see independent-domain.

no-prepend-global-as

(Optional) Specify to strip the global AS and to prepend only the local AS in AS paths sent to external peers.

private

(Optional) Configure to use the local AS only during the establishment of the BGP session with a BGP neighbor but to hide it in the AS path sent to external BGP peers.

Only the global AS is included in the AS path sent to external peers.

Note:

The private and alias options are mutually exclusive. You cannot configure both options with the same local-as statement.

Local AS Impacts on BGP AS Paths for eBGP

AS Path masquerading allows a router to establish its BGP peering sessions with a different AS than the global AS.

BGP AS numbers are added to the AS_PATH attribute to prevent routing loops. The receiving router inspects the received AS Path and rejects routes containing its own AS number in the update. The loops features can permit such loops to be accepted based on configuration.

The AS Path is also used as part of the default BGP path selection mechanism to determine the best route. Certain local-as configurations may increase the length of the AS Path, which can make routes less preferred by some routers. Some local-as features can suppress the situations where additional AS numbers are added to the AS Path.

BGP operators often rely on AS path contents for route filtering purposes. Therefore, it is important to understand the contents of the AS Path when using this feature.

Required Privilege Level

routing—To view this statement in the configuration.

routing-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

alias option introduced in Junos OS Release 9.5.

loops and no-prepend-global-as options introduced in Junos OS Release 9.6.