To match a BGP autonomous system path that is specified by an access list, use the
matchas-path command in route-map configuration mode. To remove a path list entry, use the
no form of this command.
matchas-pathpath-list-number
nomatchas-pathpath-list-number
Syntax Description
path-list-number
Access list that specifies an autonomous system path. An integer from 1 to 199.
Command Default
No matching occurs on an autonomous system path specified by an access list.
Command Modes
Route-map configuration (config-route-map)
Command History
Release
Modification
10.0
This command was introduced.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
Use the
ip as-path access-list
command to create an access list that determines which AS path is specified. Then use the
match as-path command to create a route map based on matching the access list that determined the AS path.
The values set by the combination of the
matchas-path and
setweight commands override global values. For example, the weights assigned with the
matchas-path and
setweight route-map configuration commands override the weight assigned using the
neighborweight command.
A route map can have several parts. Any route that does not match at least one
match clause relating to a
route-map command will be ignored; that is, the route will not be advertised for outbound route maps and will not be accepted for inbound route maps. If you want to modify only some data, you must configure a second route-map section with an explicit match specified.
Examples
The following example configures a route map that matches on the autonomous system path specified by access list 20:
route-map IGP2BGP
match as-path 20
Related Commands
Command
Description
ipas-pathaccess-list
Configures an AS path filter using a regular expression.
matchcommunity
Matches a BGP community.
matchinterface(IP)
Distributes routes that have their next hop out one of the interfaces specified.
matchipaddress
Distributes any routes that have a destination network number address that is permitted by a standard or extended access list, and performs policy routing on packets.
matchipnext-hop
Redistributes any routes that have a next hop router address passed by one of the access lists specified.
matchiproute-source
Redistributes routes that have been advertised by routers and access servers at the address specified by the access lists.
matchmetric(IP)
Redistributes routes with the metric specified.
matchroute-type(IP)
Redistributes routes of the specified type.
matchtag
Redistributes routes in the routing table that match the specified tags.
neighborweight
Assigns weight to a neighbor connection.
route-map(IP)
Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.
setas-path
Modifies an autonomous system path for BGP routes.
setautomatic-tag
Automatically computes the tag value in a route map configuration.
setcommunity
Sets the BGP communities attribute.
setlevel(IP)
Indicates where to import routes.
setlocal-preference
Specifies a preference value for the autonomous system path.
setmetric(BGP,OSPF,RIP)
Sets the metric value for a routing protocol.
setmetric-type
Sets the metric type for the destination routing protocol.
setnext-hop
Specifies the address of the next hop.
setorigin(BGP)
Sets the BGP origin code.
settag(IP)
Sets the value of the destination routing protocol.
setweight
Specifies the BGP weight for the routing table.
match community
To match a Border Gateway Protocol (BGP) community, use the
matchcommunity command in route-map configuration mode. To remove the
matchcommunity command from the configuration file and restore the system to its default condition where the software removes the BGP community list entry, use the
no form of this command.
Specifies a standard community list number from 1 to 99 that identifies one or more permit or deny groups of communities.
expanded-list-number
Specifies an expanded community list number from 100 to 500 that identifies one or more permit or deny groups of communities.
community-list-name
The community list name.
exact
(Optional) Indicates that an exact match is required. All of the communities and only those communities specified must be present.
Command Default
No community list is matched by the route map.
Command Modes
Route-map configuration (config-route-map)
Command History
Release
Modification
12.1
This command was introduced.
12.1(9)E
Named community list support was integrated into Cisco IOS Release 12.1(9)E.
12.2(8)T
Named community list support was integrated into Cisco IOS Release 12.2(8)T.
12.0(22)S
The maximum number of expanded extended community list numbers was changed from 199 to 500 in Cisco IOS Release 12.0(22)S.
12.2(14)S
The maximum number of expanded community lists was changed from 199 to 500 and named community list support were integrated into Cisco IOS Release 12.2(14)S.
12.2(15)T
The maximum number of expanded extended community list numbers was changed from 199 to 500 in Cisco IOS Release 12.2(15)T.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
A route map can have several parts. Any route that does not match at least one
match command relating to a
route-map command will be ignored; that is, the route will not be advertised for outbound route maps and will not be accepted for inbound route maps. If you want to modify only some data, you must configure a second route-map section with an explicit match specified.
Matching based on community list number is one of the types of
match commands applicable to BGP.
Examples
The following example shows that the routes matching community list 1 will have the weight set to 100. Any route that has community 109 will have the weight set to 100.
Router(config)# ip community-list 1 permit 109
Router(config)# route-map set_weight
Router(config-route-map)# match community 1
Router(config-route-map)# set weight 100
The following example shows that the routes matching community list 1 will have the weight set to 200. Any route that has community 109 alone will have the weight set to 200.
Router(config)# ip community-list 1 permit 109
Router(config)# route-map set_weight
Router(config-route-map)# match community1 exact
Router(config-route-map)# set weight 200
In the following example, the routes that match community list LIST_NAME will have the weight set to 100. Any route that has community 101 alone will have the weight set to 100.
Router(config)# ip community-list LIST_NAME permit 101
Router(config)# route-map set_weight
Router(config-route-map)# match community LIST_NAME
Router(config-route-map)# set weight 100
The following example shows that the routes that match expanded community list 500. Any route that has extended community 1 will have the weight set to 150.
Router(config)# ip community-list 500 permit [0-9]*
Router(config)# route-map MAP_NAME permit 10
Router(config-route-map)# match extcommunity 500
Router(config-route-map)# set weight 150
Related Commands
Command
Description
ipcommunity-list
Creates a community list for BGP and controls access to it.
route-map(IP)
Defines the conditions for redistributing routes from one routing protocol into another.
setweight
Specifies the BGP weight for the routing table.
neighbor activate
To enable the exchange of information with a Border Gateway Protocol (BGP) neighbor, use the
neighbor activate command in address family configuration mode or router configuration mode. To disable the exchange of an address with a BGP neighbor, use the
no form of this command.
no neighbor { ip-address | peer-group-name | ipv6-address% } activate
Syntax Description
ip-address
IP address of the neighboring router.
peer-group-name
Name of the BGP peer group.
ipv6-address
IPv6 address of the BGP neighbor.
%
(Optional) IPv6 link-local address identifier. This keyword needs to be added whenever a link-local IPv6 address is used outside the context of its interface.
Command Default
The exchange of addresses with BGP neighbors is enabled for the IPv4 address family. Enabling address exchange for all other address families is disabled.
Note
Address exchange for address family IPv4 is enabled by default for each BGP routing session configured with the
neighbor remote-as command unless you configure the
no bgp default ipv4-activate command before configuring the
neighbor remote-as command, or you disable address exchange for address family IPv4 with a specific neighbor by using the
no neighbor activate command.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
11.0
This command was introduced.
12.0(5)T
Support for address family configuration mode and the IPv4 address family was added.
12.2(2)T
The
ipv6-address argument and support for the IPv6 address family were added.
12.0(21)ST
This command was integrated into Cisco IOS Release 12.0(21)ST.
12.0(22)S
This command was integrated into Cisco IOS Release 12.0(22)S.
12.2(14)S
This command was integrated into Cisco IOS Release 12.2(14)S.
12.2(28)SB
This command was integrated into Cisco IOS Release 12.2(28)SB.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
The
% keyword was added
12.2(33)SXH
This command was integrated into Cisco IOS Release 12.2(33)SXH.
Cisco IOS XE Release 2.1
This command was introduced on Cisco ASR 1000 Series Routers.
15.1(2)SNG
This command was implemented on the Cisco ASR 901 Series Aggregation Services Routers.
Usage Guidelines
Use this command to advertise address information in the form of an IP or IPv6 prefix. The address prefix information is known as Network Layer Reachability Information (NLRI) in BGP.
The
% keyword is used whenever link-local IPv6 addresses are used outside the context of their interfaces. This keyword does not need to be used for non-link-local IPv6 addresses.
Note
The use of the no form of the neighbor activate command will remove all configurations associated with the neighbor both inside and outside address family configuration mode. This command is not the same as the neighbor shutdown command, and you should not use this command to disconnect a BGP adjacency.
Examples
The following example shows how to enable address exchange for address family vpnv4 for all neighbors in the BGP peer group named PEPEER and for the neighbor 10.0.0.44:
The following example shows how to enable address exchange for address family IPv4 unicast for all neighbors in the BGP peer group named group1 and for the BGP neighbor 172.16.1.1:
The following example shows how to enable address exchange for address family IPv6 for all neighbors in the BGP peer group named group2 and for the BGP neighbor 7000::2:
The following example shows that the no command will remove all configurations associated with a neighbor both inside and outside the address family configuration mode. The first set of commands shows the configuration for a specific neighbor.
The following example shows the router configuration after the use of the no command.
Device(config)# router bgp 64496
Device(config-router)# address-family ipv4 vrf vrf1
Device(config-router-af)# no neighbor 192.168.1.4 activate
01:01:19: %BGP_SESSION-5-ADJCHANGE: neighbor 192.168.1.4 IPv4 Unicast vpn vrf vrf1 topology base removed from session Neighbor deleted
01:01:19: %BGP-5-ADJCHANGE: neighbor 192.168.1.4 vpn vrf vrf1 Down Neighbor deleted
Device(config-router-af)# do show running-config | begin router bgp
router bgp 64496
bgp log-neighbor-changes
neighbor 10.0.0.1 remote-as 64496
neighbor 10.0.0.1 update-source Loopback0
!
address-family ipv4
no synchronization
no neighbor 10.0.0.1 activate
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.0.0.1 activate
neighbor 10.0.0.1 send-community extended
exit-address-family
!
address-family ipv4 vrf vrf1
no synchronization
redistribute connected
exit-address-family
This example shows the router configuration when the neighbor is reactivated.
Device(config)# router bgp 64496
Device(config-router)# address-family ipv4 vrf vrf1
Device(config-router-af)# neighbor 192.168.1.4 activate
01:02:26: %BGP-5-ADJCHANGE: neighbor 192.168.1.4 vpn vrf vrf1 Up
Device(config-router-af)# do show running-config | begin router bgp
router bgp 64496
bgp log-neighbor-changes
neighbor 10.0.0.1 remote-as 64496
neighbor 10.0.0.1 update-source Loopback0
!
address-family ipv4
no synchronization
no neighbor 10.0.0.1 activate
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.0.0.1 activate
neighbor 10.0.0.1 send-community extended
exit-address-family
!
address-family ipv4 vrf vrf1
no synchronization
redistribute connected
neighbor 192.168.1.4 remote-as 100
neighbor 192.168.1.4 version 4
neighbor 192.168.1.4 activate
exit-address-family
Related Commands
Command
Description
address-family ipv4
Places the router in address family configuration mode for configuring routing sessions, such as BGP, that use standard IPv4 address prefixes.
address-family ipv6
Places the router in address family configuration mode for configuring routing sessions, such as BGP, that use standard IPv6 address prefixes.
address-family vpnv4
Places the router in address family configuration mode for configuring routing sessions, such as BGP, that use standard VPNv4 address prefixes.
address-family vpnv6
Places the router in address family configuration mode for configuring routing sessions, such as BGP, that use standard VPNv6 address prefixes.
exit-address-family
Exits from the address family submode.
neighbor remote-as
Adds an entry to the BGP or multiprotocol BGP neighbor table.
neighbor advertise-map
To advertise the routes in the BGP table matching the configured route-map, use the
neighboradvertise-map command in router configuration mode. To disable route advertisement, use the
no form of this command.
Specifies the IPv4 address of the router that should receive conditional advertisements.
ipv6-address
Specifies the IPv6 address of the router that should receive conditional advertisements.
advertise-mapmap-name
Specifies the name of the route map that will be advertised if the conditions of the exist map or non-exist map are met.
exist-mapmap-name
Specifies the name of the exist-map that is compared with the routes in the BGP table to determine whether the advertise-map route is advertised or not.
non-exist-mapmap-name
Specifies the name of the non-exist-map that is compared with the routes in the BGP table to determine whether the advertise-map route is advertised or not.
Command Default
No default behavior or values
Command Modes
Router configuration (config-router)
Command History
Release
Modification
11.1CC
This command was introduced.
11.2
This command was integrated into Cisco IOS Release 11.2.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
15.3(2)S
This command was integrated into Cisco IOS Release 15.3(2)S.
Cisco IOS XE Release 3.9S
This command was integrated into Cisco IOS XE Release 3.9S.
Usage Guidelines
Use the
neighboradvertise-map command to conditionally advertise selected routes. The routes (prefixes) that will be conditionally advertised are defined in two route maps: an advertise map and either an exist map or non-exist map.
The route map associated with the exist map or non-exist map specifies the prefix that the BGP speaker will track.
The route map associated with the advertise map specifies the prefix that will be advertised to the specified neighbor when the condition is met.
If an exist map is configured, the condition is met when the prefix exists in both the advertise map and the exist map.
If a non-exist map is configured, the condition is met when the prefix exists in the advertise map, but does not exist in the non-exist map.
If the condition is not met, the route is withdrawn and conditional advertisement does not occur. All routes that may be dynamically advertised or not advertised need to exist in the BGP routing table for conditional advertisement to occur.
Examples
The following router configuration example configures BGP to conditionally advertise a prefix to the 10.2.1.1 neighbor using an exist map. If the prefix exists in MAP1 and MAP2, the condition is met and the prefix is advertised.
The following address family configuration example configures BGP to conditionally advertise a prefix to the 10.1.1.1 neighbor using a non-exist map. If the prefix exists in MAP3 but not MAP4, the condition is met and the prefix is advertised.
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
address-familyipv6
Places router in address family configuration mode for configuring routing sessions, such as BGP, that use standard IPv6 address prefixes
route-map
Defines the conditions for redistributing routes from one routing protocol into another, or enables policy routing.
neighbor advertisement-interval
To set the minimum route advertisement interval (MRAI) between the sending of BGP routing updates, use the
neighboradvertisement-interval command in address family or router configuration mode. To restore the default value, use theno form of this command.
Time (in seconds) is specified by an integer ranging from 0 to 600.
Command Default
eBGP sessions not in a VRF: 30 seconds
eBGP sessions in a VRF: 0 seconds
iBGP sessions: 0 seconds
Command Modes
Router configuration (config-router)
Command History
Release
Modification
10.3
This command was introduced.
12.0(7)T
Address family configuration mode was added.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
This command was modified. The default value for eBGP sessions in a VRF and for iBGP sessions changed from .5 seconds to 0 seconds.
Usage Guidelines
When the MRAI is equal to 0 seconds, BGP routing updates are sent as soon as the BGP routing table changes.
If you specify a BGP peer group by using the
peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command.
Examples
The following router configuration mode example sets the minimum time between sending BGP routing updates to 10 seconds:
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
neighborpeer-group(creating)
Creates a BGP peer group.
neighbor capability orf prefix-list
To advertise outbound route filter (ORF) capabilities to a peer router, use the
neighborcapabilityorfprefix-list command in address family or router configuration mode. To disable ORF capabilities, use the
no form of this command.
neighborip-addresscapabilityorfprefix-list
[ receive | send | both ]
noneighborip-addresscapabilityorfprefix-list
[ receive | send | both ]
Syntax Description
ip-address
The IP address of the neighbor router.
receive
(Optional) Enables the ORF prefix list capability in receive mode.
send
(Optional) Enables the ORF prefix list capability in send mode.
both
(Optional) Enables the ORF prefix list capability in both receive and send modes.
Command Default
No ORF capabilities are advertised to a peer router.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
12.0(11)ST
This command was introduced.
12.2(4)T
This command was integrated into Cisco IOS Release 12.2(4)T.
12.0(22)S
This command was integrated into Cisco IOS Release 12.0(22)S.
12.2(14)S
This command was integrated into Cisco IOS Release 12.2(14)S.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
The
neighborcapabilityorfprefix-list command is used to reduce the number of BGP prefixes that a BGP speaker sends or receives from a peer router based on prefix filtering.
In most configurations, this command will be used to advertise both send and receive ORF capabilities with theboth keyword. However, this feature can be configured in one direction between two routers with one router configured to send ORF capabilities and another router configured to receive ORF capabilities from the first router.
Examples
The following examples configure routers to advertise ORF send or receive capabilities to BGP neighbors.
Examples
The following example creates an outbound route filter and configures Router-A (10.1.1.1) to advertise the filter to Router-B (172.16.1.2). An IP prefix list named FILTER is created to specify the 192.168.1.0/24 subnet for outbound route filtering. The ORF send capability is configured on Router-A so that Router-A can advertise the outbound route filter to Router-B.
The following example configures Router-B to advertise the ORF receive capability to Router-A. Router-B will install the outbound route filter, defined in the FILTER prefix list, after ORF capabilities have been exchanged. An inbound soft reset is initiated on Router-B at the end of this configuration to activate the outbound route filter.
router bgp 200
address-family ipv4 unicast
neighbor 10.1.1.1 remote-as 100
neighbor 10.1.1.1 ebgp-multihop 255
neighbor 10.1.1.1 capability orf prefix-list receive
end
clear ip bgp 10.1.1.1 in prefix-filter
Note
The inbound soft refresh must be initiated with the
clearipbgp command in order for the BGP ORF feature to function.
Related Commands
Command
Description
neighborprefix-list
Distributes BGP neighbor information as specified in a prefix list.
neighbor default-originate
To allow a BGP speaker (the local router) to send the default route 0.0.0.0 to a neighbor for use as a default route, use the
neighbordefault-originate command in address family or router configuration mode. To send no route as a default, use the
no form of this command.
(Optional) Name of the route map. The route map allows route 0.0.0.0 to be injected conditionally.
Command Default
No default route is sent to the neighbor.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
11.0
This command was introduced.
12.0
Modifications were added to permit extended access lists.
12.0(7)T
Address family configuration mode was added.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
This command does not require the presence of 0.0.0.0 in the local router. When used with a route map, the default route 0.0.0.0 is injected if the route map contains a
matchipaddress clause and there is a route that matches the IP access list exactly. The route map can contain other match clauses also.
You can use standard or extended access lists with the
neighbordefault-originate command.
Examples
In the following router configuration example, the local router injects route 0.0.0.0 to the neighbor 172.16.2.3 unconditionally:
In the following example, the local router injects route 0.0.0.0 to the neighbor 172.16.2.3 only if there is a route to 192.168.68.0 (that is, if a route with any mask exists, such as 255.255.255.0 or 255.255.0.0):
In the following example, the last line of the configuration has been changed to show the use of an extended access list. The local router injects route 0.0.0.0 to the neighbor 172.16.2.3 only if there is a route to 192.168.68.0 with a mask of 255.255.0.0:
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
neighborebgp-multihop
Accepts and attempts BGP connections to external peers residing on networks that are not directly connected.
neighbor description
To associate a description with a neighbor, use the neighbordescription command in router configuration mode or address family configuration mode. To remove the description, use the no form of this command.
Name of an EIGRP peer group. This argument is not available in address-family configuration mode.
text
Text (up to 80 characters in length) that describes the neighbor.
Command Default
There is no description of the neighbor.
Command Modes
Router configuration (config-router)
Address family configuration (config-router-af)
Command History
Release
Modification
11.3
This command was introduced.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
15.0(1)M
This command was modified. Address-family configuration mode was added.
12.2(33)SRE
This command was integrated into Cisco IOS Release 12.2(33)SRE.
Cisco IOS XE Release 2.6
This command was integrated into Cisco IOS XE Release 2.6.
Examples
In the following examples, the description of the neighbor is “peer with example.com”:
Enters address family configuration mode to configure an EIGRP routing instance.
network(EIGRP)
Specifies the network for an EIGRP routing process.
routereigrp
Configures the EIGRP address family process.
neighbor ebgp-multihop
To accept and attempt BGP connections to external peers residing on networks that are not directly connected, use the neighborebgp-multihop command in router configuration mode. To return to the default, use the no form of this command.
(Optional) Time-to-live in the range from 1 to 255 hops.
Command Default
Only directly connected neighbors are allowed.
Command Modes
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
11.0
The peer-group-name argument was added.
12.2(33)SRA
The ipv6-address argument and support for the IPv6 address family were added.
12.2(33)SB
This command was integrated into Cisco IOS Release 12.2(33)SB.
12.2(33)SXI
This command was integrated into Cisco IOS Release 12.2(33)SXI.
Cisco IOS XE Release 3.1S
This command was integrated into Cisco IOS XE Release 3.1S.
Usage Guidelines
This feature should be used only under the guidance of Cisco technical support staff.
If you specify a BGP peer group by using the peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command.
To prevent the creation of loops through oscillating routes, the multihop will not be established if the only route to the multihop peer is the default route (0.0.0.0).
Examples
The following example allows connections to or from neighbor 10.108.1.1, which resides on a network that is not directly connected:
router bgp 109
neighbor 10.108.1.1 ebgp-multihop
Related Commands
Command
Description
neighboradvertise-mapnon-exist-map
Allows a BGP speaker (the local router) to send the default route 0.0.0.0 to a neighbor for use as a default route.
neighborpeer-group(creating)
Creates a BGP peer group.
network(BGPandmultiprotocolBGP)
Specifies the list of networks for the BGP routing process.
neighbor ha-mode graceful-restart
To enable or disable the Border Gateway Protocol (BGP) graceful restart capability for a BGP neighbor or peer group, use the
neighborha-modegraceful-restart command in router configuration mode. To remove from the configuration the BGP graceful restart capability for a neighbor, use the
no form of this command.
no neighbor
{ ip-address | peer-group-name }
ha-modegraceful-restart [disable]
Syntax Description
ip-address
IP address of the neighbor.
peer-group-name
Name of a BGP peer group.
disable
(Optional) Disables BGP graceful restart capability for a neighbor.
Command Default
BGP graceful restart capability is disabled.
Command Modes
Router configuration (config-router)
Command History
Release
Modification
12.2(33)SRC
This command was introduced.
12.2(33)SB
This command was integrated into Cisco IOS Release 12.2(33)SB.
15.1(1)SG
This command was integrated into Cisco IOS Release 15.1(1)SG.
Cisco IOS XE 3.3SG
This command was integrated into Cisco IOS XE Release 3.3SG.
Usage Guidelines
The
neighborha-modegraceful-restart command is used to enable or disable the graceful restart capability for an individual BGP neighbor or peer group in a BGP network. Use the
disable keyword to disable the graceful restart capability when graceful restart has been previously enabled for the BGP peer.
The graceful restart capability is negotiated between nonstop forwarding (NSF)-capable and NSF-aware peers in OPEN messages during session establishment. If the graceful restart capability is enabled after a BGP session has been established, the session will need to be restarted with a soft or hard reset.
The graceful restart capability is supported by NSF-capable and NSF-aware routers. A router that is NSF-capable can perform a stateful switchover (SSO) operation (graceful restart) and can assist restarting peers by holding routing table information during the SSO operation. A router that is NSF-aware functions like a router that is NSF-capable but cannot perform an SSO operation.
To enable the BGP graceful restart capability globally for all BGP neighbors, use the
bgpgraceful-restartcommand. When the BGP graceful restart capability is configured for an individual neighbor, each method of configuring graceful restart has the same priority, and the last configuration instance is applied to the neighbor.
Use the
showipbgpneighbors command to verify the BGP graceful restart configuration for BGP neighbors.
Examples
The following example enables the BGP graceful restart capability for the BGP neighbor, 172.21.1.2:
The following example enables the BGP graceful restart capability globally for all BGP neighbors and then disables the BGP graceful restart capability for the BGP peer group PG1. The BGP neighbor 172.16.1.2 is configured as a member of the peer group PG1 and inherits the disabling of the BGP graceful restart capability.
Enables the BGP graceful restart capability globally for all BGP neighbors.
ha-modegraceful-restart
Enables or disables the BGP graceful restart capability for a BGP peer session template.
showipbgpneighbors
Displays information about the TCP and BGP connections to neighbors.
neighbor inherit peer-session
To send a peer session template to a neighbor so that the neighbor can inherit the configuration, use the
neighborinheritpeer-sessioncommand in address family or router configuration mode. To stop sending the peer session template, use the
no form of this command.
This command was integrated into Cisco IOS Release 12.2(18)S.
12.3(4)T
This command was integrated into Cisco IOS Release 12.3(4)T.
12.2(27)SBC
This command was integrated into Cisco IOS Release 12.2(27)SBC.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
This command is used to send locally configured session templates to the specified neighbor. If the session template is configured to inherit configurations from other session templates, the specified neighbor will also indirectly inherit these configurations from the other session templates. A neighbor can directly inherit only one peer session template and indirectly inherit up to seven peer session templates.
Note
A Border Gateway Protocol (BGP) neighbor cannot be configured to work with both peer groups and peer templates. A BGP neighbor can be configured to belong only to a peer group or to inherit policies only from peer templates.
Examples
The following example configures the 172.16.0.1 neighbor to inherit the CORE1 peer session template. The 172.16.0.1 neighbor will also indirectly inherit the configuration from the peer session template named INTERNAL-BGP. The explicit remote-as statement is required for the neighbor inherit statement to work. If a peering is not configured, the specified neighbor will not accept the session template.
Creates a peer session template and enters session-template configuration mode.
neighbor maximum-prefix (BGP)
To control how many prefixes can be received from a neighbor, use the
neighbormaximum-prefix command in router configuration mode. To disable this function, use the
no form of this command.
Name of a Border Gateway Protocol (BGP) peer group.
maximum
Maximum number of prefixes allowed from the specified neighbor. The number of prefixes that can be configured is limited only by the available system resources on a router.
threshold
(Optional) Integer specifying at what percentage of the
maximum-prefix limit the router starts to generate a warning message. The range is from 1 to 100; the default is 75.
restart
(Optional) Configures the router that is running BGP to automatically reestablish a peering session that has been disabled because the maximum-prefix limit has been exceeded. The restart timer is configured with the
restart-interval argument.
restart-interval
(Optional) Time interval (in minutes) that a peering session is reestablished. The range is from 1 to 65535 minutes.
warning-only
(optional) Allows the router to generate a sys-log message when the
maximum-prefixlimitis exceeded, instead of terminating the peering session.
Command Default
This command is disabled by default. Peering sessions are disabled when the maximum number of prefixes is exceeded. If the
restart-interval argument is not configured, a disabled session will stay down after the maximum-prefix limit is exceeded.
threshold: 75 percent
Command Modes
Router configuration (config-router)
Command History
Release
Modification
11.3
This command was introduced.
12.0(22)S
The
restart keyword was introduced.
12.2(15)T
The
restart keyword was integrated into Cisco IOS Release 12.2(15)T.
12.2(18)S
The
restart keyword was integrated into Cisco IOS Release 12.2(18)S.
12.2(27)SBC
This command was integrated into Cisco IOS Release 12.2(27)SBC.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
15.2(4)S
This command was integrated into Cisco IOS Release 15.2(4)S.
Usage Guidelines
The
neighbormaximum-prefixcommand allows you to configure a maximum number of prefixes that a Border Gateway Protocol (BGP) routing process will accept from the specified peer. This feature provides a mechanism (in addition to distribute lists, filter lists, and route maps) to control prefixes received from a peer.
When the number of received prefixes exceeds the maximum number configured, BGP disables the peering session (by default). If the
restart keyword is configured, BGP will automatically reestablish the peering session at the configured time interval. If the
restart keyword is not configured and a peering session is terminated because the maximum prefix limit has been exceed, the peering session will not be be reestablished until the
clearipbgp command is entered. If the
warning-only keyword is configured, BGP sends only a log message and continues to peer with the sender.
There is no default limit on the number of prefixes that can be configured with this command. Limitations on the number of prefixes that can be configured are determined by the amount of available system resources.
Examples
In the following example, the maximum prefixes that will be accepted from the 192.168.1.1 neighbor is set to 1000:
In the following example, the maximum number of prefixes that will be accepted from the 192.168.2.2 neighbor is set to 5000. The router is also configured to display warning messages when 50 percent of the maximum-prefix limit (2500 prefixes) has been reached.
In the following example, the maximum number of prefixes that will be accepted from the 192.168.3.3 neighbor is set to 2000. The router is also configured to reestablish a disabled peering session after 30 minutes.
In the following example, warning messages will be displayed when the threshold of the maximum-prefix limit (500 x 0.75 = 375) for the 192.168.4.4 neighbor is exceeded:
Resets a BGP connection using BGP soft reconfiguration.
neighbor peer-group (assigning members)
To configure a BGP neighbor to be a member of a peer group, use the
neighborpeer-group command in address family or router configuration mode. To remove the neighbor from the peer group, use the
noform of this command.
IP address of the BGP neighbor that belongs to the peer group specified by the
peer-group-name argument.
ipv6-address
IPv6 address of the BGP neighbor that belongs to the peer group specified by the
peer-group-name argument.
peer-group-name
Name of the BGP peer group to which this neighbor belongs.
Command Default
There are no BGP neighbors in a peer group.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
11.0
This command was introduced.
12.0(7)T
Address family configuration mode was added.
12.2(2)T
Support for IPv6 was added.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Cisco IOS XE Release 2.1
This command was introduced on Cisco ASR 1000 Series Routers.
Usage Guidelines
The neighbor at the IP address indicated inherits all the configured options of the peer group.
Note
Using the
no form of the
neighborpeer-group command removes all of the BGP configuration for that neighbor, not just the peer group association.
Examples
The following router configuration mode example assigns three neighbors to the peer group named internal:
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
neighborpeer-group(creating)
Creates a BGP peer group.
neighborshutdown
Disables a neighbor or peer group.
neighbor peer-group (creating)
To create a BGP or multiprotocol BGP peer group, use the
neighborpeer-group command in address family or router configuration mode. To remove the peer group and all of its members, use the
noform of this command.
neighborpeer-group-namepeer-group
noneighborpeer-group-namepeer-group
Syntax Description
peer-group-name
Name of the BGP peer group.
Command Default
There is no BGP peer group.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
11.0
This command was introduced.
11.1(20)CC
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were added.
12.0(2)S
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were added.
12.0(7)T
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were removed.
Address family configuration mode was added.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
Often in a BGP or multiprotocol BGP speaker, many neighbors are configured with the same update policies (that is, same outbound route maps, distribute lists, filter lists, update source, and so on). Neighbors with the same update policies can be grouped into peer groups to simplify configuration and make update calculation more efficient.
Note
Peer group members can span multiple logical IP subnets, and can transmit, or pass along, routes from one peer group member to another.
Once a peer group is created with the
neighborpeer-group command, it can be configured with the
neighbor commands. By default, members of the peer group inherit all the configuration options of the peer group. Members also can be configured to override the options that do not affect outbound updates.
All the peer group members will inherit the current configuration as well as changes made to the peer group. Peer group members will always inherit the following configuration options by default:
remote-as (if configured)
version
update-source
outbound route-maps
outbound filter-lists
outbound distribute-lists
minimum-advertisement-interval
next-hop-self
If a peer group is not configured with a remote-as option, the members can be configured with the
neighbor {ip-address |
peer-group-name}
remote-as command. This command allows you to create peer groups containing external BGP (eBGP) neighbors.
Examples
The following example configurations show how to create these types of neighbor peer group:
internal Border Gateway Protocol (iBGP) peer group
eBGP peer group
Multiprotocol BGP peer group
In the following example, the peer group named internal configures the members of the peer group to be iBGP neighbors. By definition, this is an iBGP peer group because the
routerbgp command and the
neighborremote-as command indicate the same autonomous system (in this case, autonomous system 100). All the peer group members use loopback 0 as the update source and use set-med as the outbound route map. The
neighborinternalfilter-list2in command shows that, except for 172.16.232.55, all the neighbors have filter list 2 as the inbound filter list.
The following example defines the peer group named external-peers without the
neighborremote-as command. By definition, this is an eBGP peer group because each individual member of the peer group is configured with its respective autonomous system number separately. Thus the peer group consists of members from autonomous systems 200, 300, and 400. All the peer group members have the set-metric route map as an outbound route map and filter list 99 as an outbound filter list. Except for neighbor 172.16.232.110, all of them have 101 as the inbound filter list.
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
clearipbgppeer-group
Removes all the members of a BGP peer group.
showipbgppeer-group
Displays information about BGP peer groups.
neighbor prefix-list
To prevent distribution of Border Gateway Protocol (BGP) neighbor information as specified in a prefix list, a Connectionless Network Service (CLNS) filter expression, or a CLNS filter set, use the
neighborprefix-list command in address family or router configuration mode. To remove a filter list, use the
no form of this command.
neighbor
{ ip-address | peer-group-name }
prefix-list
{ prefix-list-name | clns-filter-expr-name | clns-filter-set-name }
{ in | out }
noneighbor
{ ip-address | peer-group-name }
prefix-list
{ prefix-list-name | clns-filter-expr-name | clns-filter-set-name }
{ in | out }
Syntax Description
ip-address
IP address of neighbor.
peer-group-name
Name of a BGP peer group.
prefix-list-name
Name of a prefix list. This argument is used only under router configuration mode.
clns-filter-expr-name
Name of a CLNS filter expression. This argument is used only under network service access point (NSAP) address family configuration mode.
clns-filter-set-name
Name of a CLNS filter set. This argument is used only under NSAP address family configuration mode.
in
Filter list is applied to incoming advertisements from that neighbor.
out
Filter list is applied to outgoing advertisements to that neighbor.
Command Default
All external and advertised address prefixes are distributed to BGP neighbors.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
12.0
This command was introduced.
12.0(7)T
Address family configuration mode was added.
12.2(8)T
Under address family configuration mode, the
prefix-list-nameargument was amended to specify the name of a CLNS filter expression or a CLNS filter set.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
This command was integrated into Cisco IOS Release 12.2(33)SRB.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Cisco IOS XE 2.6
This command was integrated into Cisco IOS XE Release 2.6.
Usage Guidelines
Using prefix lists is one of three ways to filter BGP advertisements. You can also use AS-path filters, defined with the
ipas-pathaccess-list global configuration command and used in the
neighborfilter-list command to filter BGP advertisements. The third way to filter BGP advertisements uses access or prefix lists with the
neighbordistribute-listcommand.
If you specify a BGP peer group by using the
peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command. Specifying the command with an IP address will override the value inherited from the peer group.
Use the
neighborprefix-list command in address family configuration mode to filter NSAP BGP advertisements.
Note
Do not apply both a
neighbordistribute-list and a
neighborprefix-list command to a neighbor in any given direction (inbound or outbound). These two commands are mutually exclusive, and only one command (neighbordistribute-listor
neighborprefix-list) can be applied to each inbound or outbound direction.
Examples
The following router configuration mode example applies the prefix list named
abc to incoming advertisements from neighbor 10.23.4.1:
router bgp 65200
network 192.168.1.2
neighbor 10.23.4.1 prefix-list abc in
The following address family configuration mode example applies the prefix list named
abc to incoming advertisements from neighbor 10.23.4.2:
The following router configuration mode example applies the prefix list named CustomerA to outgoing advertisements to neighbor 10.23.4.3:
router bgp 64800
network 192.168.3.6
neighbor 10.23.4.3 prefix-list CustomerA out
The following address family configuration mode example applies the CLNS filter list set named
default-prefix-only to outbound advertisements to neighbor 10.1.2.1:
Enters the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Enters the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
clearipprefix-list
Resets the hit count of the prefix list entries.
clnsfilter-expr
Creates an entry in a CLNS filter expression.
clnsfilter-set
Creates an entry in a CLNS filter set.
ipas-pathaccess-list
Defines a BGP-related access list.
ipprefix-list
Creates an entry in a prefix list.
ipprefix-listdescription
Adds a text description of a prefix list.
ipprefix-listsequence-number
Enables the generation of sequence numbers for entries in a prefix list.
neighborfilter-list
Sets up a BGP filter.
showbgpnsapfilter-list
Displays information about a filter list or filter list entries.
showipbgppeer-group
Displays information about BGP peer groups.
showipprefix-list
Displays information about a prefix list or prefix list entries.
neighbor remote-as
To add an entry to the BGP or multiprotocol BGP neighbor table, use the
neighborremote-as command in router configuration mode. To remove an entry from the table, use the
no form of this command.
(Optional) IPv6 link-local address identifier. This keyword needs to be added whenever a link-local IPv6 address is used outside the context of its interface.
peer-group-name
Name of a BGP peer group.
autonomous-system-number
Number of an autonomous system to which the neighbor belongs in the range from 1 to 65535.
In Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, and later releases, 4-byte autonomous system numbers are supported in the range from 65536 to 4294967295 in asplain notation and in the range from 1.0 to 65535.65535 in asdot notation.
In Cisco IOS Release 12.0(32)S12, 12.4(24)T, and Cisco IOS XE Release 2.3, 4-byte autonomous system numbers are supported in the range from 1.0 to 65535.65535 in asdot notation only.
For more details about autonomous system number formats, see the
routerbgp command.
When used with the
alternate-as keyword, up to five autonomous system numbers may be entered.
alternate-as
(Optional) Specifies an alternate autonomous system in which a potential dynamic neighbor can be identified. Up to five autonomous system numbers may be entered when this keyword is specified.
Command Default
There are no BGP or multiprotocol BGP neighbor peers.
Command Modes
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
11.0
The
peer-group-name argument was added.
11.1(20)CC
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were added.
12.0(7)T
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were removed.
12.2(4)T
Support for the IPv6 address family was added.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
This command was modified. The
% keyword was added.
12.2(33)SXH
This command was integrated into Cisco IOS Release 12.2(33)SXH. The
alternate-as keyword was added to support BGP dynamic neighbors.
12.2(33)SB
This command was integrated into Cisco IOS Release 12.2(33)SB.
Cisco IOS XE Release 2.1
This command was introduced on Cisco ASR 1000 Series Routers.
12.0(32)S12
This command was modified. Support for 4-byte autonomous system numbers in asdot notation only was added.
12.0(32)SY8
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
12.4(24)T
This command was modified. Support for 4-byte autonomous system numbers in asdot notation only was added.
Cisco IOS XE Release 2.3
This command was modified. Support for 4-byte autonomous system numbers in asdot notation only was added.
12.2(33)SXI1
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
12.0(33)S3
This command was modified. Support for asplain notation was added and the default format for 4-byte autonomous system numbers is now asplain.
Cisco IOS XE Release 2.4
This command was modified. Support for asplain notation was added and the default format for 4-byte autonomous system numbers is now asplain.
12.2(33)SRE
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
12.2(33)XNE
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
15.0(1)S
This command was integrated into Cisco IOS Release 15.0(1)S.
15.1(1)SG
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
Cisco IOS XE Release 3.3SG
This command was modified. Support for 4-byte autonomous system numbers in asplain and asdot notation was added.
15.1(2)SNG
This command was implemented on the Cisco ASR 901 Series Aggregation Services Routers.
15.2(1)E
This command was integrated into Cisco IOS Release 15.2(1)E.
Usage Guidelines
Specifying a neighbor with an autonomous system number that matches the autonomous system number specified in the
routerbgp global configuration command identifies the neighbor as internal to the local autonomous system. Otherwise, the neighbor is considered external.
If you specify a BGP peer group by using the
peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command.
By default, neighbors that are defined using the
neighborremote-as command in router configuration mode exchange only unicast address prefixes. To exchange other address prefix types, such as multicast and Virtual Private Network (VPN) Version 4, neighbors must also be activated in the appropriate address family configuration mode.
Use the
alternate-as keyword introduced in Cisco IOS Release 12.2(33)SXH to specify up to five alternate autonomous systems in which a dynamic BGP neighbor may be identified. BGP dynamic neighbor support allows BGP peering to a group of remote neighbors that are defined by a range of IP addresses. BGP dynamic neighbors are configured using a range of IP addresses and BGP peer groups. After a subnet range is configured and associated with a BGP peer group using the
bgplisten command and a TCP session is initiated for an IP address in the subnet range, a new BGP neighbor is dynamically created as a member of that group. The new BGP neighbor will inherit any configuration or templates for the group.
The
% keyword is used whenever link-local IPv6 addresses are used outside the context of their interfaces. This keyword does not need to be used for non-link-local IPv6 addresses.
In Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, and later releases, the Cisco implementation of 4-byte autonomous system numbers uses asplain--65538 for example--as the default regular expression match and output display format for autonomous system numbers, but you can configure 4-byte autonomous system numbers in both the asplain format and the asdot format as described in RFC 5396. To change the default regular expression match and output display of 4-byte autonomous system numbers to asdot format, use the
bgpasnotationdot command followed by the
clearipbgp* command to perform a hard reset of all current BGP sessions.
In Cisco IOS Release 12.0(32)S12, 12.4(24)T, and Cisco IOS XE Release 2.3, the Cisco implementation of 4-byte autonomous system numbers uses asdot--1.2 for example--as the only configuration format, regular expression match, and output display, with no asplain support.
Note
In Cisco IOS releases that include 4-byte ASN support, command accounting and command authorization that include a 4-byte ASN number are sent in the asplain notation irrespective of the format that is used on the command-line interface.
To ensure a smooth transition, we recommend that all BGP speakers within an autonomous system that is identified using a 4-byte autonomous system number, be upgraded to support 4-byte autonomous system numbers.
Examples
The following example specifies that a router at the address 10.108.1.2 is an internal BGP (iBGP) neighbor in autonomous system number 65200:
The following example specifies that a router at the IPv6 address 2001:0DB8:1:1000::72a is an external BGP (eBGP) neighbor in autonomous system number 65001:
The following example assigns a BGP router to autonomous system 65400, and two networks are listed as originating in the autonomous system. Then the addresses of three remote routers (and their autonomous systems) are listed. The router being configured will share information about networks 10.108.0.0 and 192.168.7.0 with the neighbor routers. The first router is a remote router in a different autonomous system from the router on which this configuration is entered (an eBGP neighbor); the second
neighborremote-as command shows an internal BGP neighbor (with the same autonomous system number) at address 10.108.234.2; and the last
neighborremote-as command specifies a neighbor on a different network from the router on which this configuration is entered (also an eBGP neighbor).
The following example, configurable only in Cisco IOS Release 12.2(33)SXH and later releases, configures a subnet range of 192.168.0.0/16 and associates this listen range with a BGP peer group. Note that the listen range peer group that is configured for the BGP dynamic neighbor feature can be activated in the IPv4 address family using the
neighboractivate command. After the initial configuration on Router 1, when Router 2 starts a BGP router session and adds Router 1 to its BGP neighbor table, a TCP session is initiated, and Router 1 creates a new BGP neighbor dynamically because the IP address of the new neighbor is within the listen range subnet.
If the
showipbgpsummary command is now entered on Router 1, the output shows the dynamically created BGP neighbor, 192.168.3.2.
Router1# show ip bgp summary
BGP router identifier 192.168.3.1, local AS number 45000
BGP table version is 1, main routing table version 1
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
*192.168.3.2 4 50000 2 2 0 0 0 00:00:37 0
* Dynamically created based on a listen range command
Dynamically created neighbors: 1/(200 max), Subnet ranges: 1
BGP peergroup group192 listen range group members:
192.168.0.0/16
The following example configures a BGP process for autonomous system 65538 and configures two external BGP neighbors in different autonomous systems using 4-byte autonomous system numbers in asplain format. This example is supported only on Cisco IOS Release 12.0(32)SY8, 12.0(33)S3, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, Cisco IOS XE Release 2.4, or later releases.
The following example configures a BGP process for autonomous system 1.2 and configures two external BGP neighbors in different autonomous systems using 4-byte autonomous system numbers in asdot format. This example requires Cisco IOS Release 12.0(32)SY8, 12.0(32)S12, 12.2(33)SRE, 12.2(33)XNE, 12.2(33)SXI1, 12.4(24)T, Cisco IOS XE Release 2.3, or a later release.
Changes the default display and the regular expression match format of BGP 4-byte autonomous system numbers from asplain (decimal values) to dot notation.
bgplisten
Associates a subnet range with a BGP peer group and activates the BGP dynamic neighbors feature.
neighborpeer-group
Creates a BGP peer group.
routerbgp
Configures the BGP routing process.
neighbor route-map
To apply a route map to incoming or outgoing routes, use the
neighborroute-map command in address family or router configuration mode. To remove a route map, use the
no form of this command.
neighbor { ip-address | peer-group-name | ipv6-address [ % ] } route-mapmap-name { in | out }
no neighbor { ip-address | peer-group-name | ipv6-address [ % ] } route-mapmap-name { in | out }
Syntax Description
ip-address
IP address of the neighbor.
peer-group-name
Name of a BGP or multiprotocol BGP peer group.
ipv6-address
IPv6 address of the neighbor.
%
(Optional) IPv6 link-local address identifier. This keyword needs to be added whenever a link-local IPv6 address is used outside the context of its interface.
map-name
Name of a route map.
in
Applies route map to incoming routes.
out
Applies route map to outgoing routes.
Command Default
No route maps are applied to a peer.
Command Modes
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
12.0(7)T
Address family configuration mode was added.
12.2(4)T
Support for IPv6 was added.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
The
% keyword was added.
12.2(33)SB
This command was integrated into Cisco IOS Release 12.2(33)SB.
Cisco IOS XE Release 2.1
This command was introduced on Cisco ASR 1000 Series Routers.
12.2(33)SXI
This command was integrated into Cisco IOS Release 12.2(33)SXI.
Usage Guidelines
When specified in address family configuration mode, this command applies a route map to that particular address family only. When specified in router configuration mode, this command applies a route map to IPv4 or IPv6 unicast routes only.
If an outbound route map is specified, it is proper behavior to only advertise routes that match at least one section of the route map.
If you specify a BGP or multiprotocol BGP peer group by using the
peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command. Specifying the command for a neighbor overrides the inbound policy that is inherited from the peer group.
The
% keyword is used whenever link-local IPv6 addresses are used outside the context of their interfaces. This keyword does not need to be used for non-link-local IPv6 addresses.
Examples
The following router configuration mode example applies a route map named internal-map to a BGP incoming route from 172.16.70.24:
router bgp 5
neighbor 172.16.70.24 route-map internal-map in
route-map internal-map
match as-path 1
set local-preference 100
The following address family configuration mode example applies a route map named internal-map to a multiprotocol BGP incoming route from 172.16.70.24:
router bgp 5
address-family ipv4 multicast
neighbor 172.16.70.24 route-map internal-map in
route-map internal-map
match as-path 1
set local-preference 100
Related Commands
Command
Description
address-familyipv4(BGP)
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IP Version 4 address prefixes.
address-familyipv6
Enters address family configuration mode for configuring routing sessions such as BGP that use standard IPv6 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPN Version 4 address prefixes.
address-familyvpnv6
Places the router in address family configuration mode for configuring routing sessions that use standard VPNv6 address prefixes.
neighborremote-as
Creates a BGP peer group.
neighbor shutdown
To disable a neighbor or peer group or to gracefully shut down a link for maintenance, use the
neighborshutdown command in router configuration mode or address family configuration mode. To reenable the neighbor or peer group, use the
no form of this command.
(Optional) Configures BGP graceful shutdown, and advertises the route with the GSHUT community and the other community, if specified.
seconds
(Optional) Number of seconds in which BGP graceful shutdown will occur.
Range is 30 to 65535 seconds.
Configure adequate time to allow iBGP peers to converge and to choose an alternate path as the best path.
community
Specifies whether another community value needs to added or not.
value
Specifies whether a value needs to added or not.
The GSHUT community is set by default. You may specify a community other than the GSHUT community, which the receiving router can use to apply a routing policy. Number from 1-4294967295.
local-preference
Advertises the route with the GSHUT community and the specified local preference value.
value
Value of the local preference assigned to routes to the neighbor.
The range is from 1 to 4294967295.
Command Default
No change is made to the status of any BGP neighbor or peer group.
Command Modes
Router configuration (config-router)
Address family configuration (config-router-af)
Command History
Release
Modification
12.0
This command was introduced.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
15.2(2)S
This command was modified. The
gracefulseconds keyword and argument, the
communityvalue keyword and argument, and the
local-preferencevalue keyword and argument were added.
Cisco IOS XE 3.6S
This command was modified. The
gracefulseconds keyword and argument, the
communityvalue keyword and argument, and the
local-preferencevalue keyword and argument were added.
Cisco IOS XE 3.7S
This command was implemented on the Cisco ASR 903 router.
15.2(4)M
This command was integrated into Cisco IOS Release 15.2(4)M.
15.2(4)S
This command was implemented on the Cisco 7200 series router.
Usage Guidelines
The
neighborshutdown command terminates any active session for the specified neighbor or peer group and removes all associated routing information. In the case of a peer group, a large number of peering sessions could be terminated suddenly.
To display a summary of BGP neighbors and peer group connections, use the
showipbgpsummary command. Those neighbors with an Idle status and the Admin entry have been disabled by the
neighborshutdown command.
“State/PfxRcd” shows the current state of the BGP session or the number of prefixes the router has received from a neighbor or peer group. When the maximum number (as set by the
neighbormaximum-prefix command) is reached, the string “PfxRcd” appears in the entry, the neighbor is shut down, and the connection is idle.
BGP Graceful Shutdown
Use the BGP Graceful Shutdown feature to shut down a link for planned, manual, maintenance operations and thereby reduce or eliminate packet loss. The feature can be configured globally (for all address families) or for the IPv4 VRF or IPv6 VRF address family.
Keep in mind that you should configure adequate time to allow iBGP peers to converge and to choose an alternate path as the best path. BGP will not prevent a network administrator from specifying too low a number of seconds, in which case there might not be enough time for graceful shutdown to occur.
If you use the
graceful keyword, you must also configure at least one of the
community or local-preference keywords. You may use both the
community and
local-preference keywords.
During graceful shutdown timer, there is no nvgen. There will be nvgen of the
neighborshutdown command only after the shutdown.
Once the graceful shutdown timer expires, the command will be nvgened as follows:
neighbor ip-addressshutdown
If you reset the sessions using the
clearipbgp command, all timers will be reset. Therefore, there will be no graceful shutdown.
Examples
The following example disables any active session for the neighbor 172.16.70.23:
neighbor 172.16.70.23 shutdown
The following example disables all peering sessions for the peer group named internal:
neighbor internal shutdown
The following example configures the specified neighbor to be gracefully shut down in 1200 seconds and advertises the route with the well-known GSHUT community and a local preference of 400:
Controls how many prefixes can be received from a neighbor.
showipbgpcommunity
Displays the neighbors that belong to various communities.
showipbgpsummary
Displays the status of all BGP connections.
neighbor soft-reconfiguration
To configure the Cisco IOS software to start storing updates, use the neighborsoft-reconfiguration command in router configuration mode. To not store received updates, use the noform of this command.
Indicates that the update to be stored is an incoming update.
Command Default
Soft reconfiguration is not enabled.
Command Modes
Router configuration (config-router)
Command History
Release
Modification
11.2
This command was introduced.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
Entering this command starts the storage of updates, which is required to do inbound
soft reconfiguration. Outbound
BGP soft reconfiguration does not require inbound soft reconfiguration to be enabled.
To use soft reconfiguration, or soft reset, without preconfiguration, both BGP peers must support the soft route refresh capability, which is advertised in the open message sent when the peers establish a TCP session. Routers running Cisco IOS software releases prior to Release 12.1 do not support the route refresh capability and must clear the BGP session using the neighborsoft-reconfiguration command. Clearing the BGP session using the neighborsoft-reconfiguration command has a negative effect on network operations and should only be used as a last resort. Routers running Cisco IOS software Release 12.1 or later releases support the route refresh capability and dynamic soft resets, and can use the clearipbgp{*| address| peer-groupname}in command to clear the BGP session.
To determine whether a BGP router supports this capability, use the showipbgpneighborscommand. If a router supports the route refresh capability, the following message is displayed:
Received route refresh capability from peer.
If you specify a BGP peer group by using the peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command.
Examples
The following example enables inbound soft reconfiguration for the neighbor 10.108.1.1. All the updates received from this neighbor will be stored unmodified, regardless of the inbound policy. When inbound soft reconfiguration is done later, the stored information will be used to generate a new set of inbound updates.
Resets a BGP connection using BGP soft reconfiguration.
neighborremote-as
Creates a BGP peer group.
showipbgpneighbors
Display information about the TCP and BGP connections to neighbors.
neighbor unsuppress-map
To selectively advertise routes previously suppressed by the
aggregate-address command, use theneighborunsuppress-map command in address family or router configuration mode. To restore the system to the default condition, use the
no form of this command.
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
Use of the
neighborunsuppress-map command allows specified suppressed routes to be advertised.
Examples
The following BGP router configuration shows that routes specified by a route map named map1 are suppressed:
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IPv4 address prefixes.
address-familyvpnv4
Places the routing in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
aggregate-address
Creates an aggregate entry in a BGP routing table.
neighborroute-map
Applies a route map to inbound or outbound routes.
neighbor update-source
To have the Cisco software allow Border Gateway Protocol (BGP) sessions to use any operational interface for TCP connections, use the
neighborupdate-source command in router configuration mode. To restore the interface assignment to the closest interface, which is called the best local address, use the
no form of this command.
(Optional) IPv6 link-local address identifier. This keyword needs to be added whenever a link-local IPv6 address is used outside the context of its interface.
peer-group-name
Name of a BGP peer group.
interface-type
Interface type.
interface-number
Interface number.
Command Default
Best local address
Command Modes
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
12.2(4)T
The
ipv6-address argument was added.
12.0(21)ST
This command was integrated into Cisco IOS Release 12.0(21)ST.
12.0(22)S
This command was integrated into Cisco IOS Release 12.0(22)S.
12.2(14)S
This command was integrated into Cisco IOS Release 12.2(14)S.
12.2(28)SB
This command was integrated into Cisco IOS Release 12.2(28)SB.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
The
% keyword was added.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Cisco IOS XE Release 2.1
This command was introduced on Cisco ASR 1000 series routers.
15.1(2)SNG
This command was implemented on the Cisco ASR 901 Series Aggregation Services Routers.
Usage Guidelines
This command can work in conjunction with the loopback interface feature described in the “Interface Configuration Overview” chapter of the Cisco IOS Interface and Hardware Component Configuration Guide.
If you specify a BGP peer group by using the
peer-group-name argument, all the members of the peer group will inherit the characteristic configured with this command.
The
neighborupdate-source command must be used to enable IPv6 link-local peering for internal or external BGP sessions.
The
% keyword is used whenever link-local IPv6 addresses are used outside the context of their interfaces and for these link-local IPv6 addresses you must specify the interface they are on. The syntax becomes <IPv6 local-link address>%<interface name>, for example, FE80::1%Ethernet1/0. Note that the interface type and number must not contain any spaces, and be used in full-length form because name shortening is not supported in this situation. The % keyword and subsequent interface syntax is not used for non-link-local IPv6 addresses.
Examples
The following example sources BGP TCP connections for the specified neighbor with the IP address of the loopback interface rather than the best local address:
The following example sources IPv6 BGP TCP connections for the specified neighbor in autonomous system 65000 with the global IPv6 address of loopback interface 0 and the specified neighbor in autonomous system 65400 with the link-local IPv6 address of Fast Ethernet interface 0/0. Note that the link-local IPv6 address of FE80::2 is on Ethernet interface 1/0.
Enables the exchange of information with a BGP neighboring router.
neighborremote-as
Adds an entry to the BGP or multiprotocol BGP neighbor table.
network (BGP and multiprotocol BGP)
To specify the networks to be advertised by the Border Gateway Protocol (BGP) and multiprotocol BGP routing processes, use the
network command in address family or router configuration mode. To remove an entry from the routing table, use the
no form of this command.
Network that BGP or multiprotocol BGP will advertise.
masknetwork-mask
(Optional) Network or subnetwork mask with mask address.
nsap-prefix
Network service access point (NSAP) prefix of the Connectionless Network Service (CLNS) network that BGP or multiprotocol BGP will advertise. This argument is used only under NSAP address family configuration mode.
route-mapmap-tag
(Optional) Identifier of a configured route map. The route map should be examined to filter the networks to be advertised. If not specified, all networks are advertised. If the keyword is specified, but no route map tags are listed, no networks will be advertised.
Command Default
No networks are specified.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
12.0
The limit of 200 network commands per BGP router was removed.
11.1(20)CC
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were added.
12.0(7)T
The
nlriunicast,
nlrimulticast, and
nlriunicastmulticast keywords were removed.
Address family configuration mode was added.
12.2(8)T
The
nsap-prefix argument was added to address family configuration mode.
12.2(25)SG
This command was integrated into Cisco IOS Release 12.2(25)SG.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2(33)SRB
This command was integrated into Cisco IOS Release 12.2(33)SRB.
12.2(33)SXH
This command was integrated into Cisco IOS Release 12.2(33)SXH.
Cisco IOS XE 2.6
This command was integrated into Cisco IOS XE Release 2.6.
Usage Guidelines
BGP and multiprotocol BGP networks can be learned from connected routes, from dynamic routing, and from static route sources.
The maximum number of
network commands you can use is determined by the resources of the router, such as the configured NVRAM or RAM.
Examples
The following example sets up network 10.108.0.0 to be included in the BGP updates:
router bgp 65100
network 10.108.0.0
The following example sets up network 10.108.0.0 to be included in the multiprotocol BGP updates:
router bgp 64800
address family ipv4 multicast
network 10.108.0.0
The following example advertises NSAP prefix 49.6001 in the multiprotocol BGP updates:
Enters the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IP Version 4 address prefixes.
address-familyvpnv4
Enters the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPNv4 address prefixes.
default-informationoriginate(BGP)
Allows the redistribution of network 0.0.0.0 into BGP.
route-map(IP)
Defines the conditions for redistributing routes from one routing protocol into another.
routerbgp
Configures the BGP routing process.
network backdoor
To specify a backdoor route to a BGP-learned prefix that provides better information about the network, use the
networkbackdoor command in address family or router configuration mode. To remove an address from the list, use the
no form of this command.
networkip-addressbackdoor
nonetworkip-addressbackdoor
Syntax Description
ip-address
IP address of the network to which you want a backdoor route.
Command Default
No network is marked as having a back door.
Command Modes
Address family configuration (config-router-af)
Router configuration (config-router)
Command History
Release
Modification
10.0
This command was introduced.
12.0(7)T
Address family configuration mode was added.
12.2(33)SRA
This command was integrated into Cisco IOS Release 12.2(33)SRA.
12.2SX
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware.
Usage Guidelines
A backdoor network is assigned an administrative distance of 200. The objective is to make Interior Gateway Protocol (IGP) learned routes preferred. A backdoor network is treated as a local network, except that it is not advertised. A network that is marked as a back door is not sourced by the local router, but should be learned from external neighbors. The BGP best path selection algorithm does not change when a network is configured as a back door.
Examples
The following address family configuration example configures network 10.108.0.0 as a local network and network 192.168.7.0 as a backdoor network:
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard IP Version 4 address prefixes.
address-familyvpnv4
Places the router in address family configuration mode for configuring routing sessions such as BGP, RIP, or static routing sessions that use standard VPN Version 4 address prefixes.
distancebgp
Allows the use of external, internal, and local administrative distances that could be a better route to a node.
network(BGPandmultiprotocolBGP)
Specifies networks to be advertised by the BGP and multiprotocol BGP routing processes.