To configure a Border Gateway Protocol (BGP) neighbor (router or VRF) and enter the neighbor configuration mode, use the neighbor command. To remove an entry, use the no form of this command.
neighbor { ip-addr | ip-prefix / length } [ remote-as { as-num [. as-num ] | route-map name }
no neighbor { ip-addr | ip-prefix / length } [ remote-as { as-num [. as-num ] | route-map name }]
ip-addr
|
IP address of the neighbor in this format: A.B.C.D.
|
ip-prefix
/
length
|
IP prefix and the length of the IP prefix. The format is x.x.x.x/
length
. The
length
range is from 1 to 32.
|
remote-as
|
(Optional) Specifies the autonomous system (AS) number of the neighbor.
|
as-num
|
Number of an AS that identifies the router to other BGP routers and tags the routing information passed along. The range is from 1 to 65535.
|
.
as-num
|
(Optional) Number of an AS that identifies the router to other BGP routers and tags the routing information passed along. The range is from 1 to 65535.
|
route-map
name
|
(Optional) Specifies a route map that matches the BGP peer AS number against a list of AS numbers or a regular expression. The name can be any case-sensitive, alphanumeric string up to 63 characters.
|
None
Neighbor address-family configuration mode
Router bgp configuration mode
Release
|
Modification
|
---|---|
5.0(3)N1(1)
|
This command was introduced.
|
This command requires the LAN Enterprise Services license.
This example shows how to configure a single-hop eBGP peering session between two BGP peers that are reachable on the same network segment through a local loopback interfaces on each router:
This example shows how to source BGP TCP connections for the specified neighbor with the IP address of the loopback interface rather than the best local address:
Command
|
Description
|
---|---|
feature bgp
|
Enables BGP on the router.
|
route-map
|
Creates a route map.
|