Neighbor configuration and neighbor policy configuration

Neighbor configuration and neighbor policy configuration commands

Command syntax Description Default CLI reference

neighbor ipv4-addr remote-as as-#

no neighbor ipv4-addr

Adds an entry to the BGP neighbor table in router configuration mode.   Adding an entry to the BGP neighbor table in router configuration mode

[no] neighbor ipv4-addr dynamic

Specifies whether to enable or disable dynamic capabilities.   Enabling or disabling dynamic capabilities

[no] neighbor ipv4-addr updated-source ipv4-addr

Specifies the IP address to be used on the local end of the TCP connection with the peer.   Specifying the IP address for local end of TCP connection with peer

[no]neighbor ipv4-addr allowas-in num-loops

Specifies the number of times this autonomous system can appear in an AS path. When not configured, or when using the no version of the command, the value of as-loops is set to its default value of 1. Specifying the number of times the autonomous system can appear in an AS path

[no] neighbor ipv4-addr as-override

Causes all occurrences of our peer’s AS to be replaced with one from an export.   Replacing occurrences of peer's AS with one from an export

[no] neighbor ipv4-addr ignore-leading-as

Some routers are capable of propagating routes without appending their own autonomous system number to the AS Path. By default, BGP will drop such routes. Allowing BGP to keep routes without AS number

[no] neighbor ipv4-addr local-as as-#

Identifies the autonomous system (AS) that BGP is representing to a peer. The default AS number for this command is the current AS (configured with the router bgp command in Global Configuration mode.) Identifying the AS that BGP is representing to a peer

[no] neighbor ipv4-addr maximum-prefix max-routes

Specifies the maximum number of routes that BGP will accept for installation into the RIB. The value defaults to “unlimited” if not specified, or if using the no version of the command. Specifying maximum number of routes for installation into the RIB

[no] neighbor ipv4-addr out-delay sec

The specified integer represents the amount of time a route must be present in the routing database before it is exported into BGP Defaults to 0 if no specified or if un-configured by using no version of command. Specifying the amount of time route is present in database before exported to BGP

[no] neighbor ipv4-addr weight weight

Preferences are the first criteria of comparison for route selection. This value defaults to the globally configured preference if it is not specified. Specifying a route's preference

[no]neighbor ipv4-addr send-community

To specify that a community’s attribute should be sent to a BGP neighbor, use the neighbor send-community command in address family or router configuration mode.   Sending a community's attribute to a BGP neighbor

[no] neighbor ipv4-addr use-med

Processes sending of MEDS and for handling received MEDs. By default MEDs are used to choose which route to use. Processing sent and received MEDs

[no] neighbor ipv4-addr timers keep-alive hold-time

To set the timers for a specific BGP peer, use the neighbor timers command in router configuration mode. The values of keep-alive and hold-time default to 60 and 180 seconds, respectively. Setting the timer for a BGP peer

clear ip bgp [neighbor ipv4-addr] [ soft ]

Resets BGP peering sessions, sends route refresh requests if ‘soft’.   Resetting BGP peering sessions

[no] neighbor ipv4-addr ibgp-multihop [ttl]

Enables or disables multi-hop peering with the specified EBGP peer, and optionally indicates the maximum number of hops (TTL.)   Enabling or disabling multi-hop peering

[no] neighbor ipv4-addr next-hop-self

Forces BGP to use the router's outbound interface address as the next hop for the route updates to the peer.   Using the router's outbound interface address as next hop

[no] neighbor ipv4-addr passive

If enabled, does not initiate a peering connection to the peer.   Specifying no peering connection to peer

[no] neighbor ipv4-addr remove-private-as

Specifies whether the private AS # should be removed from the as-path attribute of updates to the EBGP peer.   Removing the private AS number from updates to EBGP peer

[no] neighbor ipv4-addr route-reflector-client

Acts as a route-reflector for the peer.   Acting as a route-reflector for the peer

[no] neighbor ipv4-addr shutdown

Shuts down the BGP peering session without removing the associated peer configuration.   Shutting down the BGP peering session without removing peer configuration

[no] neighbor ipv4-addr route-refresh

Enables or disables the advertisement of route-refresh capability in the Open message sent to the peer.   Enabling or disabling advertisement of route-refresh capability in open message

Adding an entry to the BGP neighbor table in router configuration mode

Syntax:

neighbor ipv4-addr remote-as as-#

no neighbor ipv4-addr

Adds an entry to the BGP neighbor table in router configuration mode. To remove an entry from the table, use the no form of this command.

Specifying a neighbor with an autonomous system number that matches the autonomous system number specified in the router bgp global configuration command identifies the neighbor as internal to the local autonomous system. Otherwise, the neighbor is considered external.

Enabling or disabling dynamic capabilities

Syntax:

[no] neighbor ipv4-addr dynamic

Specifies whether to enable or disable dynamic capabilities.

BGP Dynamic Capabilities allow the communication of a change in a BGP peer’s capabilities without having to restart the peering session. The BGP implementation is done on a per-peer basis and in such a way that dynamic capabilities are supported as long as the BGP peer supports BGP Dynamic Capabilities. BGP advertises Dynamic Capabilities in the OPEN message. If a BGP peer advertises support for BGP Dynamic Capabilities in the OPEN message, then it turns on Dynamic Capabilities. Otherwise, the dynamic capabilities for this peer will be disabled. BGP supports the following BGP Dynamic Capabilities:

  • Graceful restart

  • Route refresh

Specifying the IP address for local end of TCP connection with peer

Syntax:

[no] neighbor ipv4-addr updated-source ipv4-addr

Specifies the IP address to be used on the local end of the TCP connection with the peer. This is the address of a broadcast, NBMA or loopback interface and the local address of a point-to-point interface. For external peers, the local address must be on an interface that is shared with the peer or with the peer’s gateway when a gateway is used. A session with an external peer will be opened only when an interface with the appropriate local address (through which the peer or gateway address is directly reachable) is operating. For internal peers, a peer session will be maintained when any interface with the specified local address is operating. In any case, an incoming connection will be recognized as a match for a configured peer only if it is addressed to the configured local address.

Specifying the number of times the autonomous system can appear in an AS path

Syntax:

[no]neighbor ipv4-addr allowas-in num-loops

Specifies the number of times this autonomous system can appear in an AS path. When not configured, or when using theno version of the command, the value of as-loops is set to its default value of 1.

Replacing occurrences of peer's AS with one from an export

Syntax:

[no] neighbor ipv4-addr as-override

Causes all occurrences of our peer’s AS to be replaced with one from an export.

Allowing BGP to keep routes without AS number

Syntax:

[no] neighbor ipv4-addr ignore-leading-as

Some routers are capable of propagating routes without appending their own autonomous system number to the AS Path. By default, BGP will drop such routes. Turning this parameter “on” allows BGP to keep these routes. This option should be used only if there is no doubt that these peers are not normal routers.

Identifying the AS that BGP is representing to a peer

Syntax:

[no] neighbor ipv4-addr local-as as-#

Identifies the autonomous system (AS) that BGP is representing to a peer. The default AS number for this command is the current AS (configured with the router bgp command in Global Configuration mode.) This command is valid only for external peers.

Specifying maximum number of routes for installation into the RIB

Syntax:

[no] neighbor ipv4-addr maximum-prefix max-routes

Specifies the maximum number of routes that BGP will accept for installation into the RIB. The value defaults to “unlimited” if not specified, or if using the no version of the command.

Specifying the amount of time route is present in database before exported to BGP

Syntax:

[no] neighbor ipv4-addr out-delay sec

The specified integer represents the amount of time a route must be present in the routing database before it is exported into BGP. Defaults to 0 if not specified or if unconfigured by using the no version of command.

Comparing preferences for route selection

Syntax:

[no] neighbor ipv4-addr weight weight

Preferences are the first criteria of comparison for route selection. This value defaults to the globally configured preference if it is not specified.

Sending a community's attribute to a BGP neighbor

Syntax:

[no]neighbor ipv4-addr send-community

To specify that a community’s attribute should be sent to a BGP neighbor, use the neighbor send-community command in address family or router configuration mode. To remove the entry, use the no form of this command. By default the communities attribute is sent to all peers.

Processing sent and received MEDs

Syntax:

[no] neighbor ipv4-addr use-med

Processes sending of MEDS and handles received MEDs. When two routes to the same destination are received from different peers within the same peer as, they may have different MEDs. When choosing between these routes, assuming that nothing else makes one preferable to the other (such as configured policy), the values of the differing MEDs are used to choose which route to use. In this comparison, the route with the lowest MED is preferred. Routes without MEDs are treated as having a MED value of zero. By default, MEDs are used to choose which route to use.

Setting the timer for a BGP peer

Syntax:

[no] neighbor ipv4-addr timers keep-alive hold-time

To set the timers for a specific BGP peer, use the neighbor timers command in router configuration mode. To clear the timers for a specific BGP peer, use the no form of this command. The values of keep-alive and hold-time default to 60 and 180 seconds, respectively.

The timers configured for a specific neighbor override the timers configured for all BGP neighbors using the timers command.

Resetting BGP peering sessions

Syntax:

clear ip bgp [neighbor ipv4-addr] [ soft ]

Resets BGP peering sessions; sends route refresh requests if ‘soft’.

Enabling or disabling multi-hop peering

Syntax:

[no] neighbor ipv4-addr ibgp-multihop [ttl]

Enables or disables multi-hop peering with the specified EBGP peer, and optionally indicates the maximum number of hops (TTL.)

Using the router's outbound interface address as next hop

Syntax:

[no] neighbor ipv4-addr next-hop-self

Forces BGP to use the router's outbound interface address as the next hop for the route updates to the peer.

Specifying no peering connection to peer

Syntax:

[no] neighbor ipv4-addr passive

If enabled, does not initiate a peering connection to the peer.

Removing the private AS number from updates to EBGP peer

Syntax:

[no] neighbor ipv4-addr remove-private-as

Specifies whether the private AS # should be removed from the as-path attribute of updates to the EBGP peer.

Acting as a route-reflector for the peer

Syntax:

[no] neighbor ipv4-addr route-reflector-client

Acts as a route-reflector for the peer.

Shutting down the BGP peering session without removing peer configuration

Syntax:

[no] neighbor ipv4-addr shutdown

Shuts down the BGP peering session without removing the associated peer configuration.

Enabling or disabling advertisement of route-refresh capability in open message

Syntax:

[no] neighbor ipv4-addr route-refresh

Enables or disables the advertisement of route-refresh capability in the Open message sent to the peer.