local-as
Syntax
local-as autonomous-system <loops number> <private | alias> <no-prepend-global-as>;
Hierarchy Level
[edit logical-systems logical-system-name protocols bgp], [edit logical-systems logical-system-name protocols bgp group group-name], [edit logical-systems logical-system-name protocols bgp group group-name neighbor address], [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp], [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name], [edit logical-systems logical-system-name routing-instances routing-instance-name protocols bgp group group-name neighbor address], [edit protocols bgp], [edit protocols bgp group group-name], [edit protocols bgp group group-name neighbor address], [edit routing-instances routing-instance-name protocols bgp], [edit routing-instances routing-instance-name protocols bgp group group-name], [edit routing-instances routing-instance-name protocols bgp group group-name neighbor address]
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.
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.
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 The When the 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 For loop detection purposes, the local-as autonomous-system, is considered equivalent to the global AS. Note:
The The The |
autonomous-system |
AS number.
The autonomous-system number is the AS number that the router includes in its BGP OPEN messages. Also, to understand how the |
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 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
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
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 |
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.