set protocols bgp neighbor local-as


The set protocols bgp neighbor local-as command configures an alternate local AS number that can be used to establish a session with a peer, allowing a router to appear to be a member of a second autonomous system (AS), and its real AS.

Local AS allows two autonomous systems to merge without modifying peering arrangements. This command is valid only for eBGP peers.

The delete protocols bgp neighbor local-as command restores the default, which is for a peering session to be established using the primary AS (primary AS is the real AS number specified at the time of neighbor creation using the command set protocols bgp local-as).


Command Syntax

set protocols bgp [vrf <vrf-name>] {neighbor <ip>|peer-group <peer-group>|interface <interface>} local-as <AS-NUMBER> [no-prepend [replace-as]]

set protocols bgp [vrf <vrf-name>] {neighbor <ip>|peer-group <peer-group>|interface <interface>} local-as


Parameters

Parameter

Description

vrf <vrf-name>

Optional. Specifies a VRF name. The value is a string. It’s a user-defined VRF set by the command set ip vrf <vrf-name> [description <string>].

neighbor <ip>

Specifies the IPv4/IPv6 address of a peer.

peer-group <peer-group>

Specifies a peer group.

interface <interface>

Specifies an L3 interface for BGP connection. The value could be a VLAN interface name, loopback interface name, routed interface or sub-interface name.

local-as <AS-NUMBER>

Specifies a 4-byte AS number in asplain format (z), or asdot format (x.y), where z is a number from 1 to 4294967295 and x and y are 16-bit numbers in the range 0 to 65535.

no-prepend [replace-as]

Optional. Specifies that the alternate local AS number is not prepended to the AS_PATH in BGP routes.

  • If the no-prepend attribute is specified, then the supplied local-as is not prepended to the received AS_PATH.
  • If the replace-as attribute is specified, then only the supplied local-as is prepended to the AS_PATH when transmitting local-route updates to this peer.

Note that replace-as can only be specified if no-prepend is.


Usage Guidelines

Specify an alternate AS for this BGP process when interacting with a specified peer. With no modifiers (no-prepend [replace-as]), the specified local-as is prepended to the received AS_PATH when receiving routing updates from the peer, and prepended to the outgoing AS_PATH (after the process local AS) when transmitting local routes to the peer.

NOTEs:

  • AS number configured by command set protocols bgp neighbor local-as cannot be the same as local AS number (configured by command set protocols bgp [vrf <vrf-name>local-as <AS-NUMBER>) or remote AS number of the specified peer.
  • For a switch in a BGP confederation, AS number configured in command set protocols bgp neighbor local-as cannot be the same as the AS number (configured by command set protocols bgp [vrf <vrf-name>local-as <AS-NUMBER>) of any switch in the BGP confederation.

This command is commonly used in scenarios where carriers modify their network deployments. For example, when carrier A acquires carrier B, the AS of carrier B needs to be merged into the AS of carrier A as they are located in different ASes, that is, the AS number of the carrier B is modified to the AS number of carrier A. However, during the network consolidation process, BGP peers of the original carrier B located in other ASs may not expect or be inconvenient to modify the local BGP configuration immediately, which may result in a loss of connectivity with these peers.

To ensure successful network consolidation progress, you can set the original AS number of carrier B as an alternate local AS number on carrier B by using command set protocols bgp neighbor local-as, which allows carrier B to keep connection with other BGP peers using the alternate AS number.


Example

  • Configure an alternate local AS number that can be used to establish a session with an eBGP peer.
admin@PICOS# set protocols bgp neighbor 100.1.1.134 local-as 200
admin@PICOS# commit




Copyright © 2024 Pica8 Inc. All Rights Reserved.