neighbor local-as

Causes the device to prepend the local autonomous system number (ASN) automatically to routes received from an eBGP peer.

Syntax

neighbor { ip-address | ipv6-address | peer-group-name } local-as num [ no-prepend ]
no neighbor { ip-address | ipv6-address | peer-group-name } local-as num [ no-prepend ]

Command Default

This feature is disabled.

Parameters

ip-address
IPv4 address of the neighbor.
ipv6-address
IPv6 address of the neighbor.
peer-group-name
Peer group name configured by the neighbor peer-group-name command.
num
Local ASN. Range is from 1 through 4294967295.
no-prepend
Causes the device to stop prepending the selected ASN.

Modes

BGP configuration mode

BGP address-family IPv4 unicast VRF configuration mode

BGP address-family IPv6 unicast VRF configuration mode

Usage Guidelines

Use the no form of this command to remove the local ASN.

Examples

This example ensures that a device prepends the local ASN.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# neighbor 10.11.12.13 local-as 100

This example stops the device from prepending the selected ASN.

device# configure terminal
device(config)# router bgp
device(config-bgp-router)# neighbor 10.11.12.13 local-as 100 no-prepend