B BGP CG 74x ncs540
B BGP CG 74x ncs540
B BGP CG 74x ncs540
Release 7.4.x
First Published: 2021-07-29
Americas Headquarters
Cisco Systems, Inc.
170 West Tasman Drive
San Jose, CA 95134-1706
USA
http://www.cisco.com
Tel: 408 526-4000
800 553-NETS (6387)
Fax: 408 527-0883
THE SPECIFICATIONS AND INFORMATION REGARDING THE PRODUCTS IN THIS MANUAL ARE SUBJECT TO CHANGE WITHOUT NOTICE. ALL STATEMENTS,
INFORMATION, AND RECOMMENDATIONS IN THIS MANUAL ARE BELIEVED TO BE ACCURATE BUT ARE PRESENTED WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED. USERS MUST TAKE FULL RESPONSIBILITY FOR THEIR APPLICATION OF ANY PRODUCTS.
THE SOFTWARE LICENSE AND LIMITED WARRANTY FOR THE ACCOMPANYING PRODUCT ARE SET FORTH IN THE INFORMATION PACKET THAT SHIPPED WITH
THE PRODUCT AND ARE INCORPORATED HEREIN BY THIS REFERENCE. IF YOU ARE UNABLE TO LOCATE THE SOFTWARE LICENSE OR LIMITED WARRANTY,
CONTACT YOUR CISCO REPRESENTATIVE FOR A COPY.
The Cisco implementation of TCP header compression is an adaptation of a program developed by the University of California, Berkeley (UCB) as part of UCB's public domain version of
the UNIX operating system. All rights reserved. Copyright © 1981, Regents of the University of California.
NOTWITHSTANDING ANY OTHER WARRANTY HEREIN, ALL DOCUMENT FILES AND SOFTWARE OF THESE SUPPLIERS ARE PROVIDED “AS IS" WITH ALL FAULTS.
CISCO AND THE ABOVE-NAMED SUPPLIERS DISCLAIM ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THOSE OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE.
IN NO EVENT SHALL CISCO OR ITS SUPPLIERS BE LIABLE FOR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, OR INCIDENTAL DAMAGES, INCLUDING, WITHOUT
LIMITATION, LOST PROFITS OR LOSS OR DAMAGE TO DATA ARISING OUT OF THE USE OR INABILITY TO USE THIS MANUAL, EVEN IF CISCO OR ITS SUPPLIERS
HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network
topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional
and coincidental.
All printed copies and duplicate soft copies of this document are considered uncontrolled. See the current online version for the latest version.
Cisco has more than 200 offices worldwide. Addresses and phone numbers are listed on the Cisco website at www.cisco.com/go/offices.
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL:
https://www.cisco.com/c/en/us/about/legal/trademarks.html. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a
partnership relationship between Cisco and any other company. (1721R)
© 2021 Cisco Systems, Inc. All rights reserved.
CONTENTS
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
iii
Contents
Route Dampening 39
Configuring BGP Route Dampening 39
Routing Policy Enforcement 40
Apply Policy When Updating Routing Table 41
Configure BGP Neighbor Group and Neighbors 43
Disable BGP Neighbor 46
Resetting Neighbors Using BGP Inbound Soft Reset 47
Resetting Neighbors Using BGP Outbound Soft Reset 48
Reset Neighbors Using BGP Hard Reset 48
Configure Software to Store Updates from Neighbor 49
Log Neighbor Changes 50
BGP Route Reflectors 51
Configure Route Reflector for BGP 51
Configure BGP Route Filtering by Route Policy 53
Configure BGP Attribute Filtering 54
BGP Next Hop Tracking 55
Configure BGP Next-Hop Trigger Delay 56
Disable Next-Hop Processing on BGP Updates 57
BGP Cost Community 58
Configure BGP Cost Community 58
Configure BGP Community and Extended-Community Advertisements 60
Configuring BGP Large Communities 62
Redistribute iBGP Routes into IGP 67
Redistribute IGPs to BGP 68
Update Groups 69
Monitor BGP Update Groups 69
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
iv
Contents
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
v
Contents
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
vi
Contents
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
vii
Contents
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
viii
CHAPTER 1
Implementing BGP
Border Gateway Protocol (BGP) is an Exterior Gateway Protocol (EGP) that allows you to create loop-free
interdomain routing between autonomous systems. An autonomous system is a set of routers under a single
technical administration. Routers in an autonomous system can use multiple Interior Gateway Protocols (IGPs)
to exchange routing information inside the autonomous system and an EGP to route packets outside the
autonomous system.
This module provides conceptual and configuration information on BGP.
• BGP Functional Overview, on page 1
Note VPNv4 address family is supported effective from Cisco IOS XR Release 6.1.31. However, VPNv6 and VPN
routing and forwarding (VRF) address families will be supported in a future release.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
1
Implementing BGP
Enable BGP Routing
Note • At least one neighbor and at least one address family must be configured to enable BGP routing. At least
one neighbor with both a remote AS and an address family must be configured globally using the address
family and remote as commands.
• When one BGP session has both IPv4 unicast and IPv4 labeled-unicast AFI/SAF, then the routing behavior
is nondeterministic. Therefore, the prefixes may not be correctly advertised. Incorrect prefix advertisement
results in reachability issues. In order to avoid such reachability issues, you must explicitly configure a
route policy to advertise prefixes either through IPv4 unicast or through IPv4 labeled-unicast address
families.
Note If the neighbor is configured as an external BGP (eBGP) peer, you must configure an inbound and outbound
route policy on the neighbor using the route-policy command.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
(Optional) Creates a route policy and enters route policy configuration mode, where you can define the route
policy.
Step 3 end-policy
Example:
RP/0/RP0/CPU0:router(config-rpl)# end-policy
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
2
Implementing BGP
Enable BGP Routing
(Optional) Ends the definition of a route policy and exits route policy configuration mode.
Step 5 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Step 9 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-af)# exit
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
3
Implementing BGP
Enable BGP Routing
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
prefix-set static
2020::/64,
2012::/64,
10.10.0.0/16,
10.2.0.0/24
end-set
route-policy pass-all
pass
end-policy
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
4
Implementing BGP
Adjust BGP Timers
route-policy set_next_hop_agg_v4
set next-hop 10.0.0.1
end-policy
route-policy set_next_hop_static_v4
if (destination in static) then
set next-hop 10.1.0.1
else
drop
endif
end-policy
route-policy set_next_hop_agg_v6
set next-hop 2003::121
end-policy
route-policy set_next_hop_static_v6
if (destination in static) then
set next-hop 2011::121
else
drop
endif
end-policy
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
5
Implementing BGP
Adjust BGP Timers
the interval. The values set using the timers bgp command in router configuration mode can be overridden
on particular neighbors using the timers command in the neighbor configuration mode.
Perform this task to set the timers for BGP neighbors.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Sets a default keepalive time and a default hold time for all neighbors.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
(Optional) Sets the keepalive timer and the hold-time timer for the BGP neighbor.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
6
Implementing BGP
Change BGP Default Local Preference Value
• Cancel —Remains in the configuration session, without committing the configuration changes.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Sets the default local preference value from the default of 100, making it either a more preferable path (over
100) or less preferable path (under 100).
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
7
Implementing BGP
Configure BGP Weights
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
RP/0/RP0/CPU0:router(config-bgp)# default-metric
Sets the default metric, which is used to set the MED to advertise to peers for routes that do not already have
a metric set (routes that were received with no MED attribute).
Procedure
Step 1 configure
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
8
Implementing BGP
Configure BGP Weights
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
9
Implementing BGP
Tune BGP Best-Path Calculation
• Cancel —Remains in the configuration session, without committing the configuration changes.
What to do next
You the clear bgp command for the newly configured weight to take effect.
Note The order of comparison determined by Step 2 is important because the comparison operation is not transitive;
that is, if three paths, A, B, and C exist, such that when A and B are compared, A is better, and when B and
C are compared, B is better, it is not necessarily the case that when A and C are compared, A is better. This
nontransitivity arises because the multi exit discriminator (MED) is compared only among paths from the
same neighboring autonomous system (AS) and not among all paths. BGP Best Path Algorithm, on page 135
provides additional conceptual details.
Perform this task to change the default BGP best-path calculation behavior.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
10
Implementing BGP
Set BGP Administrative Distance
Example:
Directs the BGP software to consider a missing MED attribute in a path as having a value of infinity, making
this path the least desirable path.
Configures the BGP speaker in the specified autonomous system to compare MEDs among all the paths for
the prefix, regardless of the autonomous system from which the paths are received.
Enables BGP software to compare MED values for paths learned from confederation peers.
Configures the BGP software to ignore the autonomous system length when performing best-path selection.
Configure the BGP speaker in the autonomous system to compare the router IDs of similar paths.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
11
Implementing BGP
Set BGP Administrative Distance
Administrative distance is used to discriminate between routes learned from more than one protocol. The
route with the lowest administrative distance is installed in the IP routing table. By default, BGP uses the
administrative distances shown in here:
Note Distance does not influence the BGP path selection algorithm, but it does influence whether BGP-learned
routes are installed in the IP routing table.
Perform this task to specify the use of administrative distances that can be used to prefer one class of route
over another.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
12
Implementing BGP
Indicate BGP Back-door Routes
Sets the external, internal, and local administrative distances to prefer one class of routes over another. The
higher the value, the lower the trust rating.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
13
Implementing BGP
Indicate BGP Back-door Routes
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Configures the local router to originate and advertise the specified network.
Here, Routers A and C and Routers B and C are running eBGP. Routers A and B are running an IGP
(such as Routing Information Protocol [RIP], Interior Gateway Routing Protocol [IGRP], Enhanced
IGRP, or Open Shortest Path First [OSPF]). The default distances for RIP, IGRP, Enhanced IGRP,
and OSPF are 120, 100, 90, and 110, respectively. All these distances are higher than the default
distance of eBGP, which is 20. Usually, the route with the lowest distance is preferred.
Router A receives updates about 160.10.0.0 from two routing protocols: eBGP and IGP. Because
the default distance for eBGP is lower than the default distance of the IGP, Router A chooses the
eBGP-learned route from Router C. If you want Router A to learn about 160.10.0.0 from Router B
(IGP), establish a BGP back door. See .
In the following example, a network back-door is configured:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
14
Implementing BGP
Configure Aggregate Addresses
Router A treats the eBGP-learned route as local and installs it in the IP routing table with a distance
of 200. The network is also learned through Enhanced IGRP (with a distance of 90), so the Enhanced
IGRP route is successfully installed in the IP routing table and is used to forward traffic. If the
Enhanced IGRP-learned route goes down, the eBGP-learned route is installed in the IP routing table
and is used to forward traffic.
Although BGP treats network 160.10.0.0 as a local entry, it does not advertise network 160.10.0.0
as it normally would advertise a local entry.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Creates an aggregate address. The path advertised for this route is an autonomous system set consisting of all
elements contained in all paths that are being summarized.
• The as-set keyword generates autonomous system set path information and community information
from contributing paths.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
15
Implementing BGP
Understanding BGP MD5 Authentication
• The as-confed-set keyword generates autonomous system confederation set path information from
contributing paths.
• The summary-only keyword filters all more specific routes from updates.
• The route-policy route-policy-name keyword and argument specify the route policy used to set the
attributes of the aggregate route.
Configuration
Use the following configuration to configure BGP MD5:
RP/0/RP0/CPU0:router(config)# router bgp 50
RP/0/RP0/CPU0:router(config-bgp)# address-family ipv4 unicast
RP/0/RP0/CPU0:router(config-bgp-af)# exit
RP/0/RP0/CPU0:router(config-bgp)# neighbor 10.1.1.1
RP/0/RP0/CPU0:router(config-bgp-nbr)# remote-as 51
RP/0/RP0/CPU0:router(config-bgp-nbr)# password encrypted a1b2c3
RP/0/RP0/CPU0:router(config-bgp-nbr)# commit
Running Configuration
Validate the configuration.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
16
Implementing BGP
Hiding the Local AS Number for BGP Networks
Note BGP prepends the autonomous system number from each BGP network that a route traverses. This behavior
is designed to maintain network reachability information and to prevent routing loops from occurring.
Configuring the no-prepend command incorrectly could create routing loops. So, the configuration of this
command should only be attempted by an experienced network operator.
Configuration
Use the following configuration to hide the local AS number for eBGP peers.
RP/0/RP0/CPU0:router# config
RP/0/RP0/CPU0:router(config)# router bgp 100
RP/0/RP0/CPU0:router(config-bgp)# address-family ipv4 unicast
RP/0/RP0/CPU0:router(config-bgp-af)# network 10.1.1.1 255.255.0.0
RP/0/RP0/CPU0:router(config-bgp-af)# neighbor 10.1.1.1 remote-as 100
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
17
Implementing BGP
Autonomous System Number Formats in BGP
Running Configuration
RP/0/RP0/CPU0:router# show running-configuration
...
!
router bgp 100
address-family ipv4 unicast
network 10.1.1.1 255.255.0.0
neighbor 10.1.1.1 remote-as 100
neighbor 10.1.1.1 local-as 300 no-prepend
!
Verification
Use the following command to verify your configuration.
RP/0/RP0/CPU0:router# show ip bgp neighbors
BGP neighbor is 10.1.1.1, remote AS 100, local AS 300 no-prepend, external link
BGP version 4, remote router ID 10.1.1.1
BGP state = Established, up for 00:00:49
Last read 00:00:49, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
IPv4 MPLS Label capability:
Received 10 messages, 1 notifications, 0 in queue
Sent 10 messages, 0 notifications, 0 in queue
Default minimum time between advertisement runs is 30 seconds
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
18
Implementing BGP
as-format Command
For 4-byte ASNs in asdot format, the 4-byte range is 1.0 to 65535.65535 and the format is:
high-order-16-bit-value-in-decimal . low-order-16-bit-value-in-decimal
The BGP 4-byte ASN capability is used to propagate 4-byte-based AS path information across BGP speakers
that do not support 4-byte AS numbers. See draft-ietf-idr-as4bytes-12.txt for information on increasing the
size of an ASN from 2 bytes to 4 bytes. AS is represented as a 4-byte decimal number
as-format Command
The as-format command configures the ASN notation to asdot. The default value, if the as-format command
is not configured, is asplain.
Restrictions
• The router supports maximum of 4 BGP instances.
• Each BGP instance needs a unique router-id.
• Only one Address Family can be configured under each BGP instance (VPNv4, VPNv6 and RT-Constrain
can be configured under multiple BGP instances).
• IPv4/IPv6 Unicast should be within the same BGP instance in which IPv4/IPv6 Labeled-Unicast is
configured.
• IPv4/IPv6 Multicast should be within the same BGP instance in which IPv4/IPv6 Unicast is configured.
• All configuration changes for a single BGP instance can be committed together. However, configuration
changes for multiple instances cannot be committed together.
• Cisco recommends that BGP update-source should be unique in the default VRF over all instances while
peering with the same remote router.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
19
Implementing BGP
Configure Multiple BGP Instances for a Specific Autonomous System
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Enters BGP configuration mode for the user specified BGP instance.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
20
Implementing BGP
Configure Routing Domain Confederation for BGP
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies that the BGP autonomous systems belong to a specified BGP confederation identifier. You can
associate multiple AS numbers to the same confederation identifier, as shown in the example.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
21
Implementing BGP
Configure Routing Domain Confederation for BGP
In a BGP speaker in autonomous system 6002, the peers from autonomous systems 6001 and 6003
are configured as special eBGP peers. Peer 171 .17 .70.1 is a normal iBGP peer, and peer 199.99.99.2
is a normal eBGP peer from autonomous system 700.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
22
Implementing BGP
Configure Routing Domain Confederation for BGP
In a BGP speaker in autonomous system 6003, the peers from autonomous systems 6001 and 6002
are configured as special eBGP peers. Peer 192 .168 .200.200 is a normal eBGP peer from autonomous
system 701.
The following is a part of the configuration from the BGP speaker 192 .168 .200.205 from autonomous
system 701 in the same example. Neighbor 171.16 .232.56 is configured as a normal eBGP speaker
from autonomous system 666. The internal division of the autonomous system into multiple
autonomous systems is not known to the peers external to the confederation.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
23
Implementing BGP
BGP Additional Paths
remote-as 701
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
RP/0/RP0/CPU0:router(config-rpl-else)#pass
RP/0/RP0/CPU0:router(config-rpl-else)#endif
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
24
Implementing BGP
Configure BGP Additional Paths
Step 5 end-policy
Example:
RP/0/RP0/CPU0:router(config-rpl)#end-policy
Ends the route policy definition of the route policy and exits route-policy configuration mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Step 7 address-family {ipv4 {unicast } | ipv6 {unicast | l2vpn vpls-vpws | vpnv4 unicast | vpnv6 unicast }
Example:
RP/0/RP0/CPU0:router(config-bgp)#address-family ipv4 unicast
Specifies the address family and enters address family configuration submode.
Configures receive capability of multiple paths for a prefix to the capable peers.
Configures send capability of multiple paths for a prefix to the capable peers .
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
25
Implementing BGP
BGP Maximum Prefix
When the discard extra paths configuration is removed, BGP sends a route-refresh message to the neighbor
if it supports the refresh capability; otherwise the session is flapped.
On the same lines, the following describes the actions when the maximum prefix value is changed:
• If the maximum value alone is changed, a route-refresh message is sourced, if applicable.
• If the new maximum value is greater than the current prefix count state, the new prefix states are saved.
• If the new maximum value is less than the current prefix count state, then some existing prefixes are
deleted to match the new configured state value.
When the discard extra paths configuration is removed, BGP sends a route-refresh message to the neighbor
if it supports the refresh capability; otherwise the session is flapped.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
26
Implementing BGP
Configure Discard Extra Paths
Note • When the router drops prefixes, it is inconsistent with the rest of the network, resulting in possible routing
loops.
• If prefixes are dropped, the standby and active BGP sessions may drop different prefixes. Consequently,
an NSR switchover results in inconsistent BGP tables.
• The discard extra paths configuration cannot co-exist with the soft reconfig configuration.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
27
Implementing BGP
Configure Discard Extra Paths
Example
The following example shows how to configure discard extra paths feature for the IPv4 address
family:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# router bgp 10
RP/0/RP0/CPU0:router(config-bgp)# neighbor 10.0.0.1
RP/0/RP0/CPU0:router(config-bgp-nbr)# address-family ipv4 unicast
RP/0/RP0/CPU0:router(config-bgp-nbr-af)# maximum-prefix 1000 discard-extra-paths
RP/0/RP0/CPU0:router(config-bgp-vrf-af)# commit
The following screen output shows details about the discard extra paths option:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
28
Implementing BGP
BGP Best-External Path
AIGP is enabled
An EoR was not received during read-only mode
Last ack version 1, Last synced ack version 0
Outstanding version objects: current 0, max 0
Additional-paths operation: None
Send Multicast Attributes
BGP considers the external and confederations BGP paths for a prefix to calculate the best–external path.
BGP advertises the best path and the best–external path as follows:
• On the primary PE—advertises the best path for a prefix to both its internal and external peers
• On the backup PE—advertises the best path selected for a prefix to the external peers and advertises the
best–external path selected for that prefix to the internal peers
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
29
Implementing BGP
BGP Local Label Retention
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies the address family or VRF address family and enters the address family or VRF address family
configuration submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
30
Implementing BGP
Retain Allocated Local Label for Primary Path
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies the address family and enters the address family configuration submode.
Retains the previously allocated local label for the primary path on the primary PE for 10 minutes after
reconvergence.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
31
Implementing BGP
BGP Labeled Unicast Multiple Label Stack Overview
Prerequisites
BGP Labelled unicast address-family needs to be supported.
Restrictions
Due to hardware limitations, only a maximum of three label stacks is supported; from Release 6.6.1, a maximum
of five labels are supported
Topology
The following section illustrates the topology for the BGP Labeled Unicast Multiple Label Stack feature.
Based on the multi-label stack pushed by the controller on to the head end E, the traffic is steered through the
network. In this topology, as the controller is pushing the label stack 14001, 16001, and 32001 with NH
172.6.0.1, traffic is steered through the nodes B, D, and G sequentially. If the controller needs to change the
traffic path to nodes C, F, and G sequentially, it pushes the label stack 15002, 17002, and 32001 with NH of
93.4.3.1.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
32
Implementing BGP
Configuration
Configuration
This section describes how you can configure the BGP Labeled Unicast Multiple Label Stack feature.
Configure the nexthop mpls forwarding ibgp command in BGP configuration mode. Configure the BGP
labeled unicast session with Nexthop 10.3.2.2 so the "ImpNULL" label is pushed as the first label into the
multiple-label stack.
Router# configure
Router(config)# router bgp 100
Router(config-bgp)# neighbor 10.0.1.101
Router(config-bgp)# nexthop mpls forwarding ibgp
Router(config-bgp)# address-family ipv4 unicast
Router(config-bgp-af)# allocate-label all
Router(config-bgp-af)# exit
Router(config-bgp)# neighbor 10.3.2.2
Router(config-bgp-nbr)# remote-as 100
Router(config-bgp-nbr)# address-family ipv4 labeled-unicast
Router(config-bgp)# exit
Router(config-bgp)# neighbor-group group 1
Router(config-bgp-nbrgrp)# neighbor-group group 1
Router(config-bgp-nbrgrp)# remote-as 65535
Router(config-bgp-nbrgrp)# address-family ipv4 labeled-unicast
Router(config-bgp-nbrgrp-af)# route-policy pass in
Router(config-bgp-nbrgrp-af)# route-policy pass out
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
33
Implementing BGP
Verification
Router(config-bgp-nbrgrp-af)# enforce-multiple-labels
Router(config-bgp-nbrgrp-af)# exit
Router(config-bgp-nbrgrp)# exit
Router(config-bgp)# neighbor 10.0.1.101
Router(config-bgp-nbr)# use neighbor-group ipv4lu_ng1
Router(config-bgp-nbr)# exit
Router(config-bgp)# exit
Router(config-bgp)# neighbor 10.0.1.101
Router(config-bgp-nbr)# remote-as 65535
Router(config-bgp-nbr)# address-family ipv4 labeled-unicast
Router(config-bgp-nbr-af)# route-policy pass in
Router(config-bgp-nbr-af)# route-policy pass out
Router(config-bgp-nbr-af)# route-reflector-client
Router(config-bgp-nbr-af)# enforce-multiple-labels
Running Configuration
neighbor 10.0.1.101
use neighbor-group ipv4lu_ng1
!
!
neighbor 10.0.1.101
remote-as 100
address-family ipv4 labeled-unicast
route-policy pass out
route-policy pass in
route-reflector-client
enforce-multiple-labels
!
Verification
The show outputs given in the following section display the details of configuration of the BGP LU Multiple
Label Stack feature, and the status of their configuration.
...
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
34
Implementing BGP
Verification
...
Route-Reflector Client
Attributes:
Internal
Common admin
Send communities
4-byte AS capable
Send AIGP
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
35
Implementing BGP
Verification
...
32001
32002
32002
...
/* */
Known via "bgp 100", distance 200, metric 476387081, [ei]-bgp, labeled unicast (3107)
...
NHID:0x0(Ref:0)
MPLS eid:0x1380b00000003
10.1.1.1/32, version 251579, internal 0x5000001 0x0 (ptr 0xa0241200) [1], 0x0 (0xa03feab8),
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
36
Implementing BGP
iBGP Multipath Load Sharing
0xa08
(0x9fced2b0)
...
recursion-via-/32
next hop 10.3.2.2/32 Te0/0/0/0/1 labels imposed {ImplNull 14001 16001 32001}
/* Verify the maximum supported depth of the label stack. If the number of labels received
exceeds the maximum
supported by the platform, the prefix is not downloaded to the RIB and hence routing issues
may occur. */
...
...
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
37
Implementing BGP
Configure iBGP Multipath Load Sharing
iBGP Multipath Load Sharing Reference, on page 144 provides additional details.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
38
Implementing BGP
Route Dampening
Route Dampening
Route dampening is a BGP feature that minimizes the propagation of flapping routes across an internetwork.
A route is considered to be flapping when it is repeatedly available, then unavailable, then available, then
unavailable, and so on.
For example, consider a network with three BGP autonomous systems: autonomous system 1, autonomous
system 2, and autonomous system 3. Suppose the route to network A in autonomous system 1 flaps (it becomes
unavailable). Under circumstances without route dampening, the eBGP neighbor of autonomous system 1 to
autonomous system 2 sends a withdraw message to autonomous system 2. The border router in autonomous
system 2, in turn, propagates the withdrawal message to autonomous system 3. When the route to network A
reappears, autonomous system 1 sends an advertisement message to autonomous system 2, which sends it to
autonomous system 3. If the route to network A repeatedly becomes unavailable, then available, many
withdrawal and advertisement messages are sent. Route flapping is a problem in an internetwork connected
to the Internet, because a route flap in the Internet backbone usually involves many routes.
The route dampening feature minimizes the flapping problem as follows. Suppose again that the route to
network A flaps. The router in autonomous system 2 (in which route dampening is enabled) assigns network
A a penalty of 1000 and moves it to history state. The router in autonomous system 2 continues to advertise
the status of the route to neighbors. The penalties are cumulative. When the route flaps so often that the penalty
exceeds a configurable suppression limit, the router stops advertising the route to network A, regardless of
how many times it flaps. Thus, the route is dampened.
The penalty placed on network A is decayed until the reuse limit is reached, upon which the route is once
again advertised. At half of the reuse limit, the dampening information for the route to network A is removed.
Note No penalty is applied to a BGP peer reset when route dampening is enabled, even though the reset withdraws
the route.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
39
Implementing BGP
Routing Policy Enforcement
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Note This enforcement affects only eBGP neighbors (neighbors in a different autonomous system than this router).
For internal BGP (iBGP) neighbors (neighbors in the same autonomous system), all routes are accepted or
advertised if there is no policy.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
40
Implementing BGP
Apply Policy When Updating Routing Table
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Applies the specified policy to routes being installed into the routing table.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
41
Implementing BGP
Apply Policy When Updating Routing Table
• Cancel —Remains in the configuration session, without committing the configuration changes.
Use the route-policy (BGP) command in the neighbor address-family configuration mode to apply
the pass-all policy to a neighbor. The following example shows how to allow all IPv4 unicast routes
to be received from neighbor 192.168.40.42 and advertise all IPv4 unicast routes back to it:
Use the show bgp summary command to display eBGP neighbors that do not have both an inbound
and outbound policy for every active address family. In the following example, such eBGP neighbors
are indicated in the output with an exclamation (!) mark:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
42
Implementing BGP
Configure BGP Neighbor Group and Neighbors
Note All commands that can be configured under a specified neighbor group can be configured under a neighbor.
Note Starting with Cisco IOS XR Release 7.3.1, the maximum allowed BGP neighbor value is only 110 for Cisco
6Z18G-SYS-A/D, and N540X-8Z16G-SYS-A/D variants.
Note In Cisco IOS-XR versions prior to 6.3.2, you cannot remove a autonomous system that belongs to a BGP
neighbor and move it under a BGP neigbhorgroup using a single IOS-XR commit. Effective with 6.3.2, you
can move the autonoums system from a neighbor to a neighbor group in a single IOS-XR commit.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
43
Implementing BGP
Configure BGP Neighbor Group and Neighbors
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Step 4 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-af)# exit
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Step 9 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-nbrgrp-af)# exit
Step 10 exit
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
44
Implementing BGP
Configure BGP Neighbor Group and Neighbors
Example:
RP/0/RP0/CPU0:router(config-bgp-nbrgrp)# exit
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
(Optional) Specifies that the BGP neighbor inherit configuration from the specified neighbor group.
route-policy pass-all
pass
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
45
Implementing BGP
Disable BGP Neighbor
end-policy
router bgp 109
address-family ipv4 unicast
network 172.16.0.0 255.255.0.0
network 192.168.7.0 255.255.0.0
neighbor 172.16.200.1
remote-as 167
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Step 4 shutdown
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
46
Implementing BGP
Resetting Neighbors Using BGP Inbound Soft Reset
RP/0/RP0/CPU0:router(config-bgp-nbr)# shutdown
Procedure
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
47
Implementing BGP
Resetting Neighbors Using BGP Outbound Soft Reset
Procedure
Procedure
clear bgp { ipv4 { unicast | labeled-unicast | all | tunnel tunnel | mdt } | ipv6 unicast | all |
labeled-unicast } | all { unicast | multicast | all | labeled-unicast | mdt | tunnel } | vpnv4 unicast
| vrf { vrf-name | all } { ipv4 unicast | labeled-unicast } | ipv6 unicast } | vpnv6 unicast } { * |
ip-address | as as-number | external } [ graceful ] soft [ in [ prefix-filter ] | out ] clear bgp { ipv4 |
ipv6} { unicast | labeled-unicast }
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
48
Implementing BGP
Configure Software to Store Updates from Neighbor
Note Storing updates from a neighbor works only if either the neighbor is route refresh capable or the
soft-reconfiguration inbound command is configured. Even if the neighbor is route refresh capable and the
soft-reconfiguration inbound command is configured, the original routes are not stored unless the always
option is used with the command. The original routes can be easily retrieved with a route refresh request.
Route refresh sends a request to the peer to resend its routing information. The soft-reconfiguration inbound
command stores all paths received from the peer in an unmodified form and refers to these stored paths during
the clear. Soft reconfiguration is memory intensive.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
49
Implementing BGP
Log Neighbor Changes
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Configures the software to store updates received from a specified neighbor. Soft reconfiguration inbound
causes the software to store the original unmodified route in addition to a route that is modified or filtered.
This allows a “soft clear” to be performed after the inbound policy is changed.
Soft reconfiguration enables the software to store the incoming updates before apply policy if route refresh
is not supported by the peer (otherwise a copy of the update is not stored). The always keyword forces the
software to store a copy even when route refresh is supported by the peer.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
50
Implementing BGP
BGP Route Reflectors
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Configures the local router as one of the route reflectors serving the cluster. It is configured with a specified
cluster ID to identify the cluster.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
51
Implementing BGP
Configure Route Reflector for BGP
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Step 7 route-reflector-client
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr-af)# route-reflector-client
Configures the router as a BGP route reflector and configures the neighbor as its client.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
52
Implementing BGP
Configure BGP Route Filtering by Route Policy
Procedure
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config-rpl)# pass
RP/0/RP0/CPU0:router(config-rpl)# endif
RP/0/RP0/CPU0:router(config-rpl)#
end-policy
Step 4 router bgp as-number Specifies the autonomous system number and
enters the BGP configuration mode, allowing
Example:
you to configure the BGP routing process.
RP/0/RP0/CPU0:router(config)# router bgp
120
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
53
Implementing BGP
Configure BGP Attribute Filtering
Step 7 route-policy route-policy-name { in | out Applies the specified policy to inbound routes.
}
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr-af)#
route-policy drop-as-1234 in
Step 8 Use the commit or end command. commit —Saves the configuration changes and
remains within the configuration session.
end —Prompts user to take one of these actions:
• Yes — Saves configuration changes and
exits the configuration session.
• No —Exits the configuration session
without committing the configuration
changes.
• Cancel —Remains in the configuration
session, without committing the
configuration changes.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
54
Implementing BGP
BGP Next Hop Tracking
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies the attribute-filter group name and enters the attribute-filter group configuration mode, allowing
you to configure a specific attribute filter group for a BGP neighbor.
Specifies a single or a range of attribute codes and an associated action. The allowed actions are:
• Treat-as-withdraw— Considers the update message for withdrawal. The associated IPv4-unicast or
MP_REACH NLRIs, if present, are withdrawn from the neighbor's Adj-RIB-In.
• Discard Attribute— Discards this attribute. The matching attributes alone are discarded and the rest of
the Update message is processed normally.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
55
Implementing BGP
Configure BGP Next-Hop Trigger Delay
BGP Next Hop Reference, on page 139 provides additional conceptual details on BGP next hop.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
56
Implementing BGP
Disable Next-Hop Processing on BGP Updates
• Cancel —Remains in the configuration session, without committing the configuration changes.
Note Next-hop processing can be disabled for address family group, neighbor group, or neighbor address family.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
57
Implementing BGP
BGP Cost Community
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
Step 6 next-hop-self
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr-af)# next-hop-self
Sets the next-hop attribute for all routes advertised to the specified neighbor to the address of the local router.
Disabling the calculation of the best next hop to use when advertising a route causes all routes to be advertised
with the local network device as the next hop.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
58
Implementing BGP
Configure BGP Cost Community
Enters route policy configuration mode and specifies the name of the route policy to be configured.
Step 4 end-policy
Example:
RP/0/RP0/CPU0:router(config)# end-policy
Ends the definition of a route policy and exits route policy configuration mode.
Enters BGP configuration mode allowing you to configure the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
59
Implementing BGP
Configure BGP Community and Extended-Community Advertisements
Note BGP community and extended-community filtering cannot be configured for iBGP neighbors. Communities
and extended-communities are always sent to iBGP neighbors under VPNv4, MDT, IPv4, and IPv6 address
families.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
60
Implementing BGP
Configure BGP Community and Extended-Community Advertisements
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Step 5 address-family{ipv4 {labeled-unicast | unicast | mdt | | mvpn | rt-filter | tunnel} | ipv6 {labeled-unicast
| mvpn | unicast}}
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr)# address-family ipv6 unicast
Enters neighbor address family configuration mode for the specified address family. Use either ipv4 or ipv6
address family keyword with one of the specified address family sub mode identifiers.
IPv6 address family mode supports these sub modes:
• labeled-unicast
• mvpn
• unicast
or
RP/0/RP0/CPU0:router(config-bgp-nbr-af)# send-extended-community-ebgp
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
61
Implementing BGP
Configuring BGP Large Communities
Specifies that the router send community attributes or extended community attributes (which are disabled by
default for eBGP neighbors) to a specified eBGP neighbor.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
62
Implementing BGP
Configuring BGP Large Communities
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
63
Implementing BGP
Configuring BGP Large Communities
RP/0/RP0/CPU0:router(config-largecomm)# peeras:2:3
RP/0/RP0/CPU0:router(config-largecomm)# end-set
RP/0/RP0/CPU0:router(config)# route-policy wally
RP/0/RP0/CPU0:router(config-rpl)# set large-community catbert additive
RP/0/RP0/CPU0:router(config-rpl)# end-set
In this example, if the route-policy mordac is applied to a neighbor, the ASN of which is 1, then the large
community (1:2:3) is set only once.
Note You should configure the send-community-ebgp command to send large communities to ebgp neighbors.
In this example, routes with these sets of large communities return TRUE:
• (1:1:3, 4:5:10)
• (4:5:3) —This single large community matches both specifications.
• (1:1:3, 4:5:10, 7:6:5)
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
64
Implementing BGP
Configuring BGP Large Communities
RP/0/RP0/CPU0:router(config-rpl)# end-policy
For example, routes with these sets of large communities return TRUE:
• (1:1:3, 4:5:10)
• (4:5:3)
• (1:2:3, 6:6:3, 9:4:3)
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
65
Implementing BGP
Configuring BGP Large Communities
of discard. That means, if the large community BGP path attribute is received in a BGP UPDATE message
from the neighbor 10.0.1.101 then the attribute will be discarded before further processing of the message.
Verification
This example displays the routes with large-communities given in the show bgp large-community
list-of-large-communities [exact-match ] command. If the optional keyword exact-match is used, then the
listed routes will contain only the specified large communities. Otherwise, the displayed routes may contain
additional large communities.
RP/0/0/CPU0:R1# show bgp large-community 1:2:3 5:6:7
Thu Mar 23 14:40:33.597 PDT
BGP router identifier 4.4.4.4, local AS number 3
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 66
BGP main routing table version 66
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 66/0
BGP scan interval 60 secs
This example displays the large community attached to a network using the show bgp ip-address/ prefix-length
command.
RP/0/0/CPU0:R4# show bgp 10.3.3.3/32
Thu Mar 23 14:36:15.301 PDT
BGP routing table entry for 10.3.3.3/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 42 42
Last Modified: Mar 22 20:04:46.000 for 18:31:30
Paths: (1 available, best #1)
Advertised to peers (in unique update groups):
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
66
Implementing BGP
Redistribute iBGP Routes into IGP
10.11.11.5
Path #1: Received by speaker 0
Advertised to peers (in unique update groups):
10.11.11.5
Local
10.10.10.3 from 10.10.10.3 (10.3.3.3)
Origin incomplete, metric 0, localpref 94, valid, internal, best, group-best
Received Path ID 0, Local Path ID 0, version 42
Community: 258:259 260:261 262:263 264:265
Large Community: 1:2:3 5:6:7 4123456789:4123456780:4123456788
Note Use of the bgp redistribute-internal command requires the clear route * command to be issued to reinstall
all BGP routes into the IP routing table.
Caution Redistributing iBGP routes into IGPs may cause routing loops to form within an autonomous system. Use
this command with caution.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Allows the redistribution of iBGP routes into an IGP, such as IS-IS or OSPF.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
67
Implementing BGP
Redistribute IGPs to BGP
commit —Saves the configuration changes and remains within the configuration session.
end —Prompts user to take one of these actions:
• Yes — Saves configuration changes and exits the configuration session.
• No —Exits the configuration session without committing the configuration changes.
• Cancel —Remains in the configuration session, without committing the configuration changes.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
68
Implementing BGP
Update Groups
Update Groups
The BGP Update Groups feature contains an algorithm that dynamically calculates and optimizes update
groups of neighbors that share outbound policies and can share the update messages. The BGP Update Groups
feature separates update group replication from peer group configuration, improving convergence time and
flexibility of neighbor configuration.
Procedure
show bgp [ ipv4 { unicast | multicast | all | tunnel } | ipv6 { unicast | all } | all { unicast |
multicast | all labeled-unicast | tunnel } | vpnv4 unicast | vrf { vrf-name | all } [ ipv4 unicast
ipv6 unicast ] | vpvn6 unicast ] update-group [ neighbor ip-address | process-id.index [ summary
| performance-statistics ]]
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
69
Implementing BGP
L3VPN iBGP PE-CE
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
70
Implementing BGP
Configuring L3VPN iBGP PE-CE
• iBGP PE CE CLI configuration is not available for peers under default-VRF, except for
neighbor/session-group.
• This feature does not work on regular VPN clients (eBGP VPN clients).
• Attributes packed inside the ATTR_SET reflects changes made by the inbound route-policy on the iBGP
CE and does not reflect the changes made by the export route-policy for the specified VRF.
• Different VRFs of the same VPN (that is, in different PE routers) that are configured with iBGP PE-CE
peering sessions must use different Route Distinguisher (RD) values under respective VRFs. The iBGP
PE CE feature does ot work if the RD values are the same for the ingress and egress VRF.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
71
Implementing BGP
Configuring L3VPN iBGP PE-CE
Configures a CE neighboring device with which to exchange routing information. The neighbor
internal-vpn-client command stacks the iBGP-CE neighbor path in the VPN attribute set.
Example
Example: Configuring L3VPN iBGP PE-CE
The following example shows how to configure L3VPN iBGP PE-CE:
R1(config-bgp-vrf-nbr)#neighbor 10.10.10.1 ?
. . .
internal-vpn-client Preserve iBGP CE neighbor path in ATTR_SET across VPN core
. . .
R1(config-bgp-vrf-nbr)#neighbor 10.10.10.1 internal-vpn-client
router bgp 65001
bgp router-id 100.100.100.2
address-family ipv4 unicast
address-family vpnv4 unicast
!
vrf ce-ibgp
rd 65001:100
address-family ipv4 unicast
!
neighbor 10.10.10.1
remote-as 65001
internal-vpn-client
The following is an example of the output of the show bgp vrf vrf-name neighbors ip-address
command when the L3VPN iBGP PE-CE is enabled on a CE peer:
R1#show bgp vrf ce-ibgp neighbors 10.10.10.1
BGP neighbor is 10.10.10.1, vrf ce-ibgp
Remote AS 65001, local AS 65001, internal link
Remote router ID 100.100.100.1
BGP state = Established, up for 00:00:19
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
72
Implementing BGP
Flow-tag propagation
. . .
Multi-protocol capability received
Neighbor capabilities:
Route refresh: advertised (old + new) and received (old + new)
4-byte AS: advertised and received
Address family IPv4 Unicast: advertised and received
CE attributes will be preserved across the core
Received 2 messages, 0 notifications, 0 in queue
Sent 2 messages, 0 notifications, 0 in queue
. . .
The following is an example of the output of the show bgp vpn4/vpn6 unicast rd command when
the L3VPN iBGP PE-CE is enabled on a CE peer:
BGP routing table entry for 1.1.1.0/24, Route Distinguisher: 200:300
Versions:
Process bRIB/RIB SendTblVer
Speaker 10 10
Last Modified: Aug 28 13:11:17.000 for 00:01:00
Paths: (1 available, best #1)
Advertised to update-groups (with more than one peer):
0.2
Path #1: Received by speaker 0
Advertised to update-groups (with more than one peer):
0.2
Local, (Received from a RR-client)
20.20.20.2 from 20.20.20.2 (100.100.100.2)
Received Label 24000
Origin IGP, localpref 100, valid, internal, best, group-best, import-candidate,
not-in-vrf Received Path ID 0, Local Path ID 1, version 10
Extended community: RT:228:237
ATTR-SET [
Origin-AS: 200
AS-Path: 51320 52325 59744 12947 21969 50346 18204 36304 41213
23906 33646
Origin: incomplete
Metric: 204
Local-Pref: 234
Aggregator: 304 34.3.3.3
Atomic Aggregator
Community: 1:60042 2:41661 3:47008 4:9280 5:39778 6:1069 7:15918
8:8994 9:52701
10:10268 11:26276 12:8506 13:7131 14:65464 15:14304 16:33615 17:54991
18:40149 19:19401
Extended community: RT:100:1 RT:1.1.1.1:1]
Flow-tag propagation
The flow-tag propagation feature enables you to establish a co-relation between route-policies and user-policies.
Flow-tag propagation using BGP allows user-side traffic-steering based on routing attributes such as, AS
number, prefix lists, community strings and extended communities. Flow-tag is a logical numeric identifier
that is distributed through RIB as one of the routing attribute of FIB entry in the FIB lookup table. A flow-tag
is instantiated using the 'set' operation from RPL and is referenced in the C3PL PBR policy, where it is
associated with actions (policy-rules) against the flow-tag value.
You can use flow-tag propagation to:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
73
Implementing BGP
Restrictions for Flow-Tag Propagation
• Classify traffic based on destination IP addresses (using the Community number) or based on prefixes
(using Community number or AS number).
• Select a TE-group that matches the cost of the path to reach a service-edge based on customer site service
level agreements (SLA).
• Apply traffic policy (TE-group selection) for specific customers based on SLA with its clients.
• Divert traffic to application or cache server.
Note You will not be able to enable both QPPB and flow tag feature simultaneously on an interface.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
RP/0/RP0/CPU0:router(config-if)# interface
Enters interface configuration mode and associates one or more interfaces to the VRF.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
74
Implementing BGP
BGP Keychains
Example:
Example
The following show commands display outputs with PBR policy applied on the router:
show running-config interface gigabitEthernet 0/0/0/12
Thu Feb 12 01:51:37.820 UTC
interface GigabitEthernet0/0/0/12
service-policy type pbr input flowMatchPolicy
ipv4 bgp policy propagation input flow-tag source
ipv4 address 192.5.1.2 255.255.255.0
!
BGP Keychains
BGP keychains enable keychain authentication between two BGP peers. The BGP endpoints must both comply
with draft-bonica-tcp-auth-05.txt and a keychain on one endpoint and a password on the other endpoint does
not work.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
75
Implementing BGP
Configure Keychains for BGP
BGP is able to use the keychain to implement hitless key rollover for authentication. Key rollover specification
is time based, and in the event of clock skew between the peers, the rollover process is impacted. The
configurable tolerance specification allows for the accept window to be extended (before and after) by that
margin. This accept window facilitates a hitless key rollover for applications (for example, routing and
management protocols).
The key rollover does not impact the BGP session, unless there is a keychain configuration mismatch at the
endpoints resulting in no common keys for the session traffic (send or accept).
Note If a keychain is configured for a neighbor group or a session group, a neighbor using the group inherits the
keychain. Values of commands configured specifically for a neighbor override inherited values.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
76
Implementing BGP
Master Key Tuple Configuration
Example:
TCP-AO is compatible with Master Key Tuple (MKT) configuration. TCP-AO also protects connections
when using the same MKT across repeated instances of a connection. TCP-AO protects the connections by
using traffic key that are derived from the MKT, and then coordinates changes between the endpoints.
Note TCPAO and TCP MD5 are never permitted to be used simultaneously. TCP-AO supports IPv6, and is fully
compatible with the proposed requirements for the replacement of TCP MD5.
The system translates each key, such “key_id” that is under a keychain, as MKT. The keychain configuration
owns part of the configuration like secret, lifetimes, and algorithms. While the “tcp ao keychain” mode owns
the TCP AO-specific configuration for an MKT (send_id and receive_id).
Keychain Configurations
Configuration Guidelines
In order to run a successful configuration, ensure that you follow the configuration guidelines:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
77
Implementing BGP
Configuration Guidelines for TCP AO BGP Neighbor
Note If you configure one of these options, the system rejects the other authentication
options during the configuration time.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
78
Implementing BGP
Keychain Configuration
• TCP does not have any restriction on the number of keychains and keys under a keychain. The system
does not support more than 4000 keychains, any number higher than 4000 might result in unexpected
behaviors.
Keychain Configuration
key chain <keychain_name>
key <key_id>
accept-lifetime <start-time> <end-time>
key-string <master-key>
send-lifetime <start-time> <end-time>
cryptographic-algorithm <algorithm>
!
!
TCP Configuration
TCP provides a new tcp ao submode that specifies SendID and ReceiveID per key_id per keychain.
tcp ao
keychain <keychain_name1>
key-id <key_id> send_id <0-255> receive_id <0-255>
!
Example:
tcp ao
keychain bgp_ao
key 0 SendID 0 ReceiveID 0
key 1 SendID 1 ReceiveID 1
key 2 SendID 3 ReceiveID 4
!
keychain ldp_ao
key 1 SendID 100 ReceiveID 200
key 120 SendID 1 ReceiveID 1
!
BGP Configurations
Applications like BGP provide the tcp-ao keychain and related information that it uses per neighbor. Following
are the optional configurations per tcp-ao keychain:
• include-tcp-options
• accept-non-ao-connections
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
79
Implementing BGP
XML Configurations
XML Configurations
BGP XML
TCP-AO XML
<?xml version="1.0" encoding="UTF-8"?>
<Request>
<Set>
<Configuration>
<IP_TCP>
<AO>
<Enable>
true
</Enable>
<KeychainTable>
<Keychain>
<Naming>
<Name> bgp_ao_xml </Name>
</Naming>
<Enable>
true
</Enable>
<KeyTable>
<Key>
<Naming>
<KeyID> 0 </KeyID>
</Naming>
<SendID> 0 </SendID>
<ReceiveID> 0 </ReceiveID>
</Key>
</KeyTable>
</Keychain>
</KeychainTable>
</AO>
</IP_TCP>
</Configuration>
</Set>
<Commit/>
</Request>
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
80
Implementing BGP
Disable BGP Nonstop Routing
Note In some scenarios, it is possible that some or all bgp sessions are not NSR-READY. The show redundancy
command may still show that the bgp sessions are NSR-ready. Hence, we recommend that you verify the bgp
nsr state by using the show bgp sessions command.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number, and enters the BGP configuration mode, for configuring BGP routing processes.
configure
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
81
Implementing BGP
Re-enable BGP Nonstop Routing
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number, and enters the BGP configuration mode, for configuring BGP routing processes.
configure
router bgp 120
nsr
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
82
Implementing BGP
Accumulated Interior Gateway Protocol Attribute
end
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
83
Implementing BGP
Originate Prefixes with AiGP
Step 4 exit
Example:
RP/0/RP0/CPU0:router(config-rpl)# exit
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
route-policy aigp-policy
set aigp-metric 4
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
84
Implementing BGP
Configure BGP Accept Own
Note BGP Accept Own is supported only for VPNv4 and VPNv6 address families in neighbor configuration mode.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
85
Implementing BGP
Configure BGP Accept Own
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Allows sessions to use the primary IP address from a specific interface as the local address when forming a
session with a neighbor.
Specifies the address family as VPNv4 or VPNv6 and enters neighbor address family configuration mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
86
Implementing BGP
Configure BGP Accept Own
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
87
Implementing BGP
BGP Link-State
accept-own
route-policy drop_111.x.x.x out
!
!
BGP Link-State
BGP Link-State (LS) is an Address Family Identifier (AFI) and Sub-address Family Identifier (SAFI) defined
to carry interior gateway protocol (IGP) link-state database through BGP. BGP LS delivers network topology
information to topology servers and Application Layer Traffic Optimization (ALTO) servers. BGP LS allows
policy-based control to aggregation, information-hiding, and abstraction. BGP LS supports IS-IS and OSPFv2.
Note IGPs do not use BGP LS data from remote peers. BGP does not download the received BGP LS data to any
other component on the router.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
88
Implementing BGP
Configure BGP Link-state
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
RP/0/RP0/CPU0:router(config-bgp-nbr)# remote-as 1
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
89
Implementing BGP
Configure Domain Distinguisher
Example
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
90
Implementing BGP
BGP Permanent Network
Example:
Restrictions
These restrictions apply while configuring the permanent network:
• Permanent network prefixes must be specified by the route-policy on the global address family.
• You must configure the permanent network with route-policy in global address family configuration
mode and then configure it on the neighbor address family configuration mode.
• When removing the permanent network configuration, remove the configuration in the neighbor address
family configuration mode and then remove it from the global address family configuration mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
91
Implementing BGP
Configure BGP Permanent Network
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Enters prefix set configuration mode and defines a prefix set for contiguous and non-contiguous set of bits.
Step 3 exit
Example:
RP/0/RP0/CPU0:router(config-pfx)# exit
Exits prefix set configuration mode and enters global configuration mode.
Creates a route policy and enters route policy configuration mode, where you can define the route policy.
Step 5 end-policy
Example:
RP/0/RP0/CPU0:router(config-rpl)# end-policy
Ends the definition of a route policy and exits route policy configuration mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
92
Implementing BGP
Advertise Permanent Network
Example:
Specifies the autonomous system number and enters the BGP configuration mode.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
Configures the permanent network (path) for the set of prefixes as defined in the route-policy.
Procedure
Step 1 configure
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
93
Implementing BGP
Advertise Permanent Network
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode.
Places the router in neighbor configuration mode for BGP routing and configures the neighbor IP address as
a BGP peer.
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
94
Implementing BGP
Enable BGP Unequal Cost Recursive Load Balancing
(Optional) Displays whether the neighbor is capable of receiving BGP permanent networks.
RP/0/RP0/CPU0:router# configure
Step 2 router bgp as-number Specifies the autonomous system number and
enters the BGP configuration mode, allowing
Example:
you to configure the BGP routing process.
RP/0/RP0/CPU0:router(config)# router bgp
120
Step 3 address-family { ipv4 | ipv6 } unicast Specifies either an IPv4 or IPv6 address family
unicast and enters address family configuration
Example:
submode.
RP/0/RP0/CPU0:router(config-bgp)# To see a list of all the possible keywords and
address-family ipv4 unicast arguments for this command, use the CLI help
(?).
Step 4 maximum-paths { ebgp | ibgp | eibgp } Configures the maximum number of parallel
maximum [ unequal-cost ] routes that BGP installs in the routing table.
Example: • ebgp maximum : Consider only eBGP
paths for multipath.
RP/0/RP0/CPU0:router(config-bgp-af)#
maximum-paths ebgp 3 • ibgp maximum [ unequal-cost ]:
Consider load balancing between iBGP
learned paths.
• eibgp maximum : Consider both eBGP
and iBGP learned paths for load balancing.
eiBGP load balancing always does
unequal-cost load balancing.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
95
Implementing BGP
DMZ Link Bandwidth for Unequal Cost Recursive Load Balancing
RP/0/RP0/CPU0:router(config-bgp-af)# exit
RP/0/RP0/CPU0:router(config-bgp)#
neighbor 10.0.0.0
Step 8 Use the commit or end command. commit —Saves the configuration changes and
remains within the configuration session.
end —Prompts user to take one of these actions:
• Yes — Saves configuration changes and
exits the configuration session.
• No —Exits the configuration session
without committing the configuration
changes.
• Cancel —Remains in the configuration
session, without committing the
configuration changes.
Note Unequal cost recursive load balancing happens across maximum eight paths only.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
96
Implementing BGP
Enable BGP Unequal Cost Recursive Load Balancing
Procedure
RP/0/RP0/CPU0:router# configure
Step 2 router bgp as-number Specifies the autonomous system number and
enters the BGP configuration mode, allowing
Example:
you to configure the BGP routing process.
RP/0/RP0/CPU0:router(config)# router bgp
120
Step 3 address-family { ipv4 | ipv6 } unicast Specifies either an IPv4 or IPv6 address family
unicast and enters address family configuration
Example:
submode.
RP/0/RP0/CPU0:router(config-bgp)# To see a list of all the possible keywords and
address-family ipv4 unicast arguments for this command, use the CLI help
(?).
Step 4 maximum-paths { ebgp | ibgp | eibgp } Configures the maximum number of parallel
maximum [ unequal-cost ] routes that BGP installs in the routing table.
Example: • ebgp maximum : Consider only eBGP
paths for multipath.
RP/0/RP0/CPU0:router(config-bgp-af)#
maximum-paths ebgp 3 • ibgp maximum [ unequal-cost ]:
Consider load balancing between iBGP
learned paths.
• eibgp maximum : Consider both eBGP
and iBGP learned paths for load balancing.
eiBGP load balancing always does
unequal-cost load balancing.
RP/0/RP0/CPU0:router(config-bgp-af)# exit
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
97
Implementing BGP
DMZ Link Bandwidth Over EBGP Peer
RP/0/RP0/CPU0:router(config-bgp)#
neighbor 10.0.0.0
Step 8 Use the commit or end command. commit —Saves the configuration changes and
remains within the configuration session.
end —Prompts user to take one of these actions:
• Yes — Saves configuration changes and
exits the configuration session.
• No —Exits the configuration session
without committing the configuration
changes.
• Cancel —Remains in the configuration
session, without committing the
configuration changes.
Use the bgp bestpath as-path multipath-relaxand bgp bestpath as-path ignore commands to handle
multipath across different autonomous systems.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
98
Implementing BGP
Sending and Receiving DMZ Link Bandwidth Extended Community over eBGP Peer
Sending and Receiving DMZ Link Bandwidth Extended Community over eBGP Peer
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Enters the neighbor configuration mode for configuring BGP routing sessions.
Sends the DMZ link bandwidth extended community to the eBGP neighbor.
Note Use the cumulative keyword with this command to set the value of the link bandwidth extended
community to the sum of link bandwidth values of all the egress multipaths.
Step 5 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr)# exit
Exits the neighbor configuration mode and enters into BGP configuration mode.
Enters the neighbor configuration mode for configuring BGP routing sessions.
Step 7 ebgp-recv-extcommunity-dmz
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
99
Implementing BGP
Sending and Receiving DMZ Link Bandwidth Extended Community over eBGP Peer
RP/0/RP0/CPU0:router(config-bgp-nbr)# ebgp-recv-extcommunity-dmz
Receives the DMZ link bandwidth extended community to the eBGP neighbor.
Step 8 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr)# exit
Exits the neighbor configuration mode and enters into BGP configuration mode.
The following is a sample configuration that displays the DMZ link bandwidth configuration in the
sending (R1) router:
RP/0/RP0/CPU0:router)# show bgp ipv4 unicast 10.1.1.1/32 detail
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
100
Implementing BGP
BGP Prefix Origin Validation using RPKI
The following is a sample configuration that displays DMZ link bandwidth configuration in the
receiving (R2) router:
RP/0/RP0/CPU0:router)# show bgp ipv4 unicast 10.1.1.1/32 detail
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
101
Implementing BGP
Configure RPKI Cache-server
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
Enters rpki-server configuration mode and enables configuration of RPKI cache parameters.
Or
RP/0/RP0/CPU0:router(config-bgp-rpki-server)#transport tcp port 2
Note • Do not specify a custom port number for RPKI cache transport over SSH. You must use port
22 for RPKI over SSH.
• You can set the transport to either TCP or SSH. Change of transport causes the cache session
to flap.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
102
Implementing BGP
Configure RPKI Cache-server
Specifies a preference value for the RPKI cache. Range for the preference value is 1 to 10. Setting a lower
preference value is better.
Configures the time BGP waits to keep routes from a cache after the cache session drops. Set purge time in
seconds. Range for the purge time is 30 to 360 seconds.
Or
RP/0/RP0/CPU0:router(config-bgp-rpki-server)#refresh-time off
Configures the time BGP waits in between sending periodic serial queries to the cache. Set refresh-time in
seconds. Range for the refresh time is 15 to 3600 seconds.
Configure the off option to specify not to send serial-queries periodically.
Or
RP/0/RP0/CPU0:router(config-bgp-rpki-server)#response-time off
Configures the time BGP waits for a response after sending a serial or reset query. Set response-time in
seconds. Range for the response time is 15 to 3600 seconds.
Configure the off option to wait indefinitely for a response.
Step 11 shutdown
Example:
RP/0/RP0/CPU0:router(config-bgp-rpki-server)#shutdown
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
103
Implementing BGP
Configure BGP Prefix Validation
• Cancel —Remains in the configuration session, without committing the configuration changes.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
104
Implementing BGP
Configure RPKI Bestpath Computation
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the BGP AS number and enters the BGP configuration mode, allowing you to configure the BGP
routing process.
Enables the validity states of BGP paths to affect the path's preference in the BGP bestpath process. This
configuration can also be done in router BGP address family submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
105
Implementing BGP
Resilient Per-CE Label Allocation Mode
Note This configuration can also be done at global address family, neighbor, and neighbor address family
submodes. Configuring rpki bestpath origin-as allow invalid in router BGP and address family
submodes allow all "invalid" paths to be considered for BGP bestpath computation. By default, all
such paths are not bestpath candidates. Configuring pki bestpath origin-as allow invalid in neighbor
and neighbor address family submodes allow all "invalid" paths from that specific neighbor or
neighbor address family to be considered as bestpath candidates. The neighbor must be an eBGP
neighbor.
This configuration takes effect only when the rpki bestpath use origin-as validity configuration is enabled.
Per-Prefix Label Release 7.3.1 You can configure connected routes and static routes in
Allocation per-prefix mode on the BVI. However, dynamic protocols
Support on BVI such as BGP in per-prefix mode on the BVI is not
supported.
The Resilient Per-CE Label Allocation is an extension of the Per-CE label allocation mode to support Prefix
Independent Convergence (PIC) and load balancing. At present, the three label allocation modes, Per-Prefix,
Per-CE, and Per-VRF have these restrictions:
• No support for PIC
• No support for load balancing across CEs
• Temporary forwarding loop during local traffic diversion to support PIC
• No support for EIBGP multipath load balancing
• Forwarding performance impact
• Per-prefix label allocation mode causes scale issues on another vendor router in a network
In the Resilient Per-CE label allocation scheme, BGP installs a unique rewrite label in LSD for every unique
set of CE paths or next hops. There may be one or more prefixes in BGP table that points to this label. BGP
also installs the CE paths (primary) and optionally a backup PE path into RIB. FIB learns about the label
rewrite information from LSD and the IP paths from RIB. In steady state, labeled traffic destined to the resilient
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
106
Implementing BGP
Configure Resilient Per-CE Label Allocation Mode Under VRF Address Family
per-CE label is load balanced across all the CE next hops. When all the CE paths fail, any traffic destined to
that label will result in an IP lookup and will be forwarded towards the backup PE path, if available. This
action is performed on the label independently of the number of prefixes that may point to the label, resulting
in the PIC behavior during primary paths failure.
Configure Resilient Per-CE Label Allocation Mode Under VRF Address Family
Perform this task to configure resilient per-ce label allocation mode under VRF address family.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)#
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Step 3 vrfvrf-instance
Example:
Specifies either an IPv4 or IPv6 address family unicast and enters address family configuration submode.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
107
Implementing BGP
Configure Resilient Per-CE Label Allocation Mode Using Route-Policy
• end
• commit
Example:
RP/0/RP0/CPU0:router(config-bgp-vrf-af)# end
or
RP/0/RP0/CPU0:router(config-bgp-vrf-af)# commit
• Entering yes saves configuration changes to the running configuration file, exits the configuration
session, and returns the router to EXEC mode.
• Entering no exits the configuration session and returns the router to EXEC mode without committing
the configuration changes.
• Entering cancel leaves the router in the current configuration session without exiting or committing
the configuration changes.
• Use the commit command to save the configuration changes to the running configuration file and remain
within the configuration session.
This example shows how to configure resilient per-ce label allocation mode under VRF address
family:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# router bgp 666
RP/0/RP0/CPU0:router(config-bgp)# vrf vrf-pe
RP/0/RP0/CPU0:router(config-bgp-vrf)# address-family ipv4 unicast
RP/0/RP0/CPU0:router(config-bgp-vrf-af)# label mode per-ce
RP/0/RP0/CPU0:router(config-bgp-vrf-af)# end
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)#
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
108
Implementing BGP
Configure Resilient Per-CE Label Allocation Mode Using Route-Policy
Step 2 route-policypolicy-name
Example:
RP/0/RP0/CPU0:router(config-rpl)# end
or
RP/0/RP0/CPU0:router(config-rpl)# commit
• Entering yes saves configuration changes to the running configuration file, exits the configuration
session, and returns the router to EXEC mode.
• Entering no exits the configuration session and returns the router to EXEC mode without committing
the configuration changes.
• Entering cancel leaves the router in the current configuration session without exiting or committing
the configuration changes.
• Use the commit command to save the configuration changes to the running configuration file and remain
within the configuration session.
This example shows how to configure resilient per-ce label allocation mode using a route-policy:
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# route-policy route1
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
109
Implementing BGP
BGP VRF Dynamic Route Leaking
A route-policy is mandatory to filter the imported routes. This reduces the risk of unintended import of routes
between the Internet table and the VRF tables and the corresponding security issues. There is no hard limit
on the number of prefixes that can be imported. The import creates a new prefix in the destination VRF, which
increases the total number of prefixes and paths. However, each VRF importing global routes adds workload
equivalent to a neighbor receiving the global table. This is true even if the user filters out all but a few prefixes.
Hence, importing five to ten VRFs is ideal.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
110
Implementing BGP
Configure VRF Dynamic Route Leaking
Enters mode.
or
RP/0/RP0/CPU0:router(config-vrf-af)#export to default-vrf route-policy
rpl_dynamic_route_export
Imports routes from default-VRF to non-default VRF or from non-default VRF to default-VRF.
• import from default-vrf—configures import from default-VRF to non-default-VRF.
If the advertise-as-vpn option is configured, the paths imported from the default-VRF to the
non-default-VRF are advertised to the PEs as well as to the CEs. If the advertise-as-vpn option is not
configured, the paths imported from the default-VRF to the non-default-VRF are not advertised to the
PE. However, the paths are still advertised to the CEs.
• export to default-vrf—configures import from non-default-VRF to default VRF. The paths imported
from the default-VRF are advertised to other PEs.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
111
Implementing BGP
Configuring a VPN Routing and Forwarding Instance in BGP
vrf vrf_1
address-family ipv6 unicast
import from default-vrf route-policy rpl_dynamic_route_import
!
end
vrf vrf_1
address-family ipv6 unicast
export to default-vrf route-policy rpl_dynamic_route_export
!
end
What to do next
These show bgp command output displays information from the dynamic route leaking configuration:
• Use the show bgp prefix command to display the source-RD and the source-VRF for imported paths,
including the cases when IPv4 or IPv6 unicast prefixes have imported paths.
• Use the show bgp imported-routes command to display IPv4 unicast and IPv6 unicast address-families
under the default-VRF.
The following tasks are used to configure a VPN routing and forwarding (VRF) instance in BGP:
Procedure
Step 1 configure
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
112
Implementing BGP
Define Virtual Routing and Forwarding Tables in Provider Edge Routers
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies either the IPv4 or IPv6 address family and enters address family configuration submode.
To see a list of all the possible keywords and arguments for this command, use the CLI help (?).
(Optional) Provides finer control over what gets imported into a VRF. This import filter discards prefixes that
do not match the specified policy-name argument.
Specifies a list of route target (RT) extended communities. Only prefixes that are associated with the specified
import route target extended communities are imported into the VRF.
(Optional) Provides finer control over what gets exported into a VRF. This export filter discards prefixes that
do not match the specified policy-name argument.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
113
Implementing BGP
Configure Route Distinguisher
Specifies a list of route target extended communities. Export route target communities are associated with
prefixes when they are advertised to remote PEs. The remote PEs import them into VRFs which have import
RTs that match these exported route target communities.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Enters BGP configuration mode allowing you to configure the BGP routing process.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
114
Implementing BGP
Configure Route Distinguisher
Example:
RP/0/RP0/CPU0:router(config-bgp-vrf)# rd 345:567
RP/0/RP0/CPU0:router(config-bgp-vrf)# end
or
RP/0/RP0/CPU0:router(config-bgp-vrf)# commit
• Entering yes saves configuration changes to the running configuration file, exits the configuration
session, and returns the router to XR EXEC mode.
• Entering no exits the configuration session and returns the router to XR EXEC mode without
committing the configuration changes.
• Entering cancel leaves the router in the current configuration session without exiting or committing
the configuration changes.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
115
Implementing BGP
Configure PE-PE or PE-RR Interior BGP Sessions
• Use the commit command to save the configuration changes to the running configuration file and remain
within the configuration session.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Enters mode.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Step 4 exit
Example:
RP/0/RP0/CPU0:router(config-bgp-af)# exit
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
116
Implementing BGP
Configure PE-PE or PE-RR Interior BGP Sessions
RP/0/RP0/CPU0:router(config-bgp-nbr)# remote-as 1
(Optional) Provides a description of the neighbor. The description is used to save comments and does not
affect software function.
Enables Message Digest 5 (MD5) authentication on the TCP connection between the two BGP neighbors.
Step 9 shutdown
Example:
RP/0/RP0/CPU0:router(config-bgp-nbr)# shutdown
Terminates any active sessions for the specified neighbor and removes all associated routing information.
Allows iBGP sessions to use the primary IP address from a specific interface as the local address when forming
an iBGP session with a neighbor.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
117
Implementing BGP
Configure BGP as PE-CE Protocol
Specifies a routing policy for an inbound route. The policy can be used to filter routes or modify route attributes.
Specifies a routing policy for an outbound route. The policy can be used to filter routes or modify route
attributes.
Procedure
RP/0/RP0/CPU0:router# configure
Step 2 router bgp as-number Specifies the autonomous system number and
enters the BGP configuration mode, allowing
Example:
you to configure the BGP routing process.
RP/0/RP0/CPU0:router(config)# router
bgp 120
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
118
Implementing BGP
Configure BGP as PE-CE Protocol
RP/0/RP0/CPU0:router(config-bgp)# vrf
vrf_pe_2
RP/0/RP0/CPU0:router(config-bgp-vrf)#
bgp router-id 172.16.9.9
Step 6 address-family { ipv4 | ipv6 } unicast Specifies either an IPv4 or IPv6 address family
unicast and enters address family configuration
Example:
submode.
RP/0/RP0/CPU0:router(config-vrf)# To see a list of all the possible keywords and
address-family ipv4 unicast arguments for this command, use the CLI help
(?).
RP/0/RP0/CPU0:router(config-bgp-vrf-af)#
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
119
Implementing BGP
Configure BGP as PE-CE Protocol
RP/0/RP0/CPU0:router(config-bgp-vrf-af)#
exit
RP/0/RP0/CPU0:router(config-bgp-vrf)#
neighbor 10.0.0.0
RP/0/RP0/CPU0:router(config-bgp-vrf-nbr)#
remote-as 2
Step 12 password { clear | encrypted } password Enable Message Digest 5 (MD5) authentication
on a TCP connection between two BGP
Example:
neighbors.
RP/0/RP0/CPU0:router(config-bgp-vrf-nbr)#
password encrypted 234xyz
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
120
Implementing BGP
Configure BGP as PE-CE Protocol
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
121
Implementing BGP
Resetting an eBGP Session Immediately Upon Link Failure
Step 20 Use the commit or end command. commit —Saves the configuration changes
and remains within the configuration session.
end —Prompts user to take one of these
actions:
• Yes — Saves configuration changes and
exits the configuration session.
• No —Exits the configuration session
without committing the configuration
changes.
• Cancel —Remains in the configuration
session, without committing the
configuration changes.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
122
Implementing BGP
BGP Default Limits
• By using the highest IPv4 address on a loopback interface in the system if the router is booted with saved
loopback address configuration.
• By using the primary IPv4 address of the first loopback address that gets configured if there are not any
in the saved configuration.
If none of these methods for obtaining a router ID succeeds, BGP does not have a router ID and cannot establish
any peering sessions with BGP neighbors. In such an instance, an error message is entered in the system log,
and the show bgp summary command displays a router ID of 0.0.0.0. After BGP has obtained a router ID,
it continues to use it even if a better router ID becomes available. This usage avoids unnecessary flapping for
all BGP sessions. However, if the router ID currently in use becomes invalid (because the interface goes down
or its configuration is changed), BGP selects a new router ID (using the rules described) and all established
peering sessions are reset.
Note We strongly recommend that the bgp router-id command is configured to prevent unnecessary changes to
the router ID (and consequent flapping of BGP sessions).
Note Starting with Cisco IOS XR Release 7.3.1, the maximum number of prefixes that
are supported on Cisco 6Z18G-SYS-A/D, and N540X-8Z16G-SYS-A/D variants
are:
• 32K for IPv4
• 8K for IPv6
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
123
Implementing BGP
BGP Default Limits
A cease notification message is sent to the neighbor and the peering with the neighbor is terminated when
the number of prefixes that are received from the peer for a given address family exceeds the maximum
limit (either set by default or configured by the user) for that address family.
It is possible that the maximum number of prefixes for a neighbor for a given address family has been
configured after the peering with the neighbor has been established and some prefixes have already been
received from the neighbor for that address family. A cease notification message is sent to the neighbor
and peering with the neighbor is terminated immediately after the configuration if the configured maximum
number of prefixes is fewer than the number of prefixes that have already been received from the neighbor
for the address family.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
124
Implementing BGP
BGP Attributes and Operators
aggregation as-path in —
is-local
length
neighbor-is
originates-from
passes-through
unique-length
destination in —
next-hop in set
origin is set
source in —
suppress-route — suppress-route
weight — set
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
125
Implementing BGP
BGP Attributes and Operators
allocate-label as-path in —
is-local
length
neighbor-is
originates-from
passes-through
unique-length
community is-empty —
matches-any
matches-every
destination in —
label — set
next-hop in —
origin is —
source in —
clear-policy as-path in —
is-local
length
neighbor-is
originates-from
passes-through
unique-length
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
126
Implementing BGP
BGP Attributes and Operators
dampening as-path in —
is-local
length
neighbor-is
originates-from
passes-through
unique-length
community is-empty —
matches-any
matches-every
destination in —
next-hop in —
origin is —
source in —
debug destination in —
rib-has-route in —
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
127
Implementing BGP
BGP Attributes and Operators
destination in —
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
128
Implementing BGP
BGP Attributes and Operators
origin is set
route-aggregated route-aggregated NA
source in —
weight — set
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
129
Implementing BGP
BGP Attributes and Operators
destination in —
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
130
Implementing BGP
BGP Attributes and Operators
next-hop in set
set self
origin is set
path-type is —
rd in —
route-aggregated route-aggregated —
source in —
unsuppress-route — unsuppress-route
vpn-distinguisher — set
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
131
Implementing BGP
BGP Attributes and Operators
community — set
set additive
delete-in
delete-not-in
delete-all
destination in —
mpls-label route-has-label —
local-preference — set
med — set
set+
set-
next-hop in set
origin — set
route-type is —
weight — set
next-hop destination in —
protocol is,in —
source in —
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
132
Implementing BGP
BGP Attributes and Operators
community — set
set additive
delete in
delete not in
delete all
destination in —
local-preference — set
med — set
set+
set-
next-hop in set
origin — set
mpls-label route-has-label —
route-type is —
weight — set
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
133
Implementing BGP
BGP Attributes and Operators
show as-path in —
is-local
length
neighbor-is
originates-from
passes-through
unique-length
community is-empty —
matches-any
matches-every
destination in —
extcommunity rt is-empty —
matches-any
matches-every
matches-within
next-hop in —
origin is —
source in —
Some BGP route attributes are inaccessible from some BGP attach points for various reasons. For example,
the set med igp-cost only command makes sense when there is a configured igp-cost to provide a source
value.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
134
Implementing BGP
BGP Best Path Algorithm
This table summarizes which operations are valid and where they are valid.
Note The order of comparison determined by Part 2 is important because the comparison operation is not transitive;
that is, if three paths, A, B, and C exist, such that when A and B are compared, A is better, and when B and
C are compared, B is better, it is not necessarily the case that when A and C are compared, A is better. This
nontransitivity arises because the multi exit discriminator (MED) is compared only among paths from the
same neighboring autonomous system (AS) and not among all paths.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
135
Implementing BGP
Comparing Pairs of Paths
Note The weight is entirely local to the router, and can be set with the weight command or using a routing policy.
4. If the paths have unequal local preferences, the path with the higher local preference is chosen.
Note If a local preference attribute was received with the path or was set by a routing policy, then that value is used
in this comparison. Otherwise, the default local preference value of 100 is used. The default value can be
changed using the bgp default local-preference command.
5. If one of the paths is a redistributed path, which results from a redistribute or network command, then
it is chosen. Otherwise, if one of the paths is a locally generated aggregate, which results from an
aggregate-address command, it is chosen.
Note Step 1 through Step 4 implement the “Path Selection with BGP”of RFC 1268.
6. If the paths have unequal AS path lengths, the path with the shorter AS path is chosen. This step is
skipped if bgp bestpath as-path ignore command is configured.
Note When calculating the length of the AS path, confederation segments are ignored, and AS sets count as 1.
Note eiBGP specifies internal and external BGP multipath peers. eiBGP allows simultaneous use of internal and
external paths.
7. If the paths have different origins, the path with the lower origin is selected. Interior Gateway Protocol
(IGP) is considered lower than EGP, which is considered lower than INCOMPLETE.
8. If appropriate, the MED of the paths is compared. If they are unequal, the path with the lower MED is
chosen.
A number of configuration options exist that affect whether or not this step is performed. In general,
the MED is compared if both paths were received from neighbors in the same AS; otherwise the MED
comparison is skipped. However, this behavior is modified by certain configuration options, and there
are also some corner cases to consider.
If the bgp bestpath med always command is configured, then the MED comparison is always performed,
regardless of neighbor AS in the paths. Otherwise, MED comparison depends on the AS paths of the
two paths being compared, as follows:
• If a path has no AS path or the AS path starts with an AS_SET, then the path is considered to be
internal, and the MED is compared with other internal paths.
• If the AS path starts with an AS_SEQUENCE, then the neighbor AS is the first AS number in the
sequence, and the MED is compared with other paths that have the same neighbor AS.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
136
Implementing BGP
Order of Comparisons
• If the AS path contains only confederation segments or starts with confederation segments followed
by an AS_SET, then the MED is not compared with any other path unless the bgp bestpath med
confed command is configured. In that case, the path is considered internal and the MED is
compared with other internal paths.
• If the AS path starts with confederation segments followed by an AS_SEQUENCE, then the
neighbor AS is the first AS number in the AS_SEQUENCE, and the MED is compared with other
paths that have the same neighbor AS.
Note If no MED attribute was received with the path, then the MED is considered to be 0 unless the bgp bestpath
med missing-as-worst command is configured. In that case, if no MED attribute was received, the MED is
considered to be the highest possible value.
9. If one path is received from an external peer and the other is received from an internal (or confederation)
peer, the path from the external peer is chosen.
10. If the paths have different IGP metrics to their next hops, the path with the lower IGP metric is chosen.
11. If the paths have unequal IP cost communities, the path with the lower IP cost community is selected
as the best path.
12. If all path parameters in Step 1 through Step 10 are the same, then the router IDs are compared. If the
path was received with an originator attribute, then that is used as the router ID to compare; otherwise,
the router ID of the neighbor from which the path was received is used. If the paths have different router
IDs, the path with the lower router ID is chosen.
Note Where the originator is used as the router ID, it is possible to have two paths with the same router ID. It is
also possible to have two BGP sessions with the same peer router, and therefore receive two paths with the
same router ID.
13. If the paths have different cluster lengths, the path with the shorter cluster length is selected. If a path
was not received with a cluster list attribute, it is considered to have a cluster length of 0.
14. Finally, the path received from the neighbor with the lower IP address is chosen. Locally generated
paths (for example, redistributed paths) are considered to have a neighbor IP address of 0.
Order of Comparisons
The second part of the BGP best-path algorithm implementation determines the order in which the paths
should be compared. The order of comparison is determined as follows:
1. The paths are partitioned into groups such that within each group the MED can be compared among all
paths. The same rules as in #unique_125 are used to determine whether MED can be compared between
any two paths. Normally, this comparison results in one group for each neighbor AS. If the bgp bestpath
med always command is configured, then there is just one group containing all the paths.
2. The best path in each group is determined. Determining the best path is achieved by iterating through all
paths in the group and keeping track of the best one seen so far. Each path is compared with the best-so-far,
and if it is better, it becomes the new best-so-far and is compared with the next path in the group.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
137
Implementing BGP
Best Path Change Suppression
3. A set of paths is formed containing the best path selected from each group in Step 2. The overall best path
is selected from this set of paths, by iterating through them as in Step 2.
Note This suppression behavior does not comply with the IETF Networking Working Group draft-ietf-idr-bgp4-24.txt
document, but is specified in the IETF Networking Working Group draft-ietf-idr-avoid-transition-00.txt
document.
The suppression behavior can be turned off by configuring the bgp bestpath compare-routerid command.
If this command is configured, the new best path is always preferred to the existing one.
Otherwise, the following steps are used to determine whether the best-path change can be suppressed:
1. If the existing best path is no longer valid, the change cannot be suppressed.
2. If either the existing or new best paths were received from internal (or confederation) peers or were locally
generated (for example, by redistribution), then the change cannot be suppressed. That is, suppression is
possible only if both paths were received from external peers.
3. If the paths were received from the same peer (the paths would have the same router-id), the change cannot
be suppressed. The router ID is calculated using rules in #unique_125.
4. If the paths have different weights, local preferences, origins, or IGP metrics to their next hops, then the
change cannot be suppressed. Note that all these values are calculated using the rules in #unique_125.
5. If the paths have different-length AS paths and the bgp bestpath as-path ignore command is not
configured, then the change cannot be suppressed. Again, the AS path length is calculated using the rules
in #unique_125.
6. If the MED of the paths can be compared and the MEDs are different, then the change cannot be suppressed.
The decision as to whether the MEDs can be compared is exactly the same as the rules in #unique_125,
as is the calculation of the MED value.
7. If all path parameters in Step 1 through Step 6 do not apply, the change can be suppressed.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
138
Implementing BGP
BGP Cost Community Reference
For the best optimization of BGP update group generation, we recommend that the network operator keeps
outbound routing policy the same for neighbors that have similar outbound policies. This feature contains
commands for monitoring BGP update groups.
However, a noncritical event is sent along with the critical events if the noncritical event is pending and there
is a request to read the critical events.
• Critical events are related to the reachability (reachable and unreachable), connectivity (connected and
unconnected), and locality (local and nonlocal) of the next hops. Notifications for these events are not
delayed.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
139
Implementing BGP
BGP Next Hop Reference
• Noncritical events include only the IGP metric changes. These events are sent at an interval of 3 seconds.
A metric change event is batched and sent 3 seconds after the last one was sent.
The next-hop trigger delay for critical and noncritical events can be configured to specify a minimum batching
interval for critical and noncritical events using the nexthop trigger-delay command. The trigger delay is
address family dependent.
The BGP next-hop tracking feature allows you to specify that BGP routes are resolved using only next hops
whose routes have the following characteristics:
• To avoid the aggregate routes, the prefix length must be greater than a specified value.
• The source protocol must be from a selected list, ensuring that BGP routes are not used to resolve next
hops that could lead to oscillation.
This route policy filtering is possible because RIB identifies the source protocol of route that resolved a next
hop as well as the mask length associated with the route. The nexthop route-policy command is used to
specify the route-policy.
Next Hop as the IPv6 Address of Peering Interface
BGP can carry IPv6 prefixes over an IPv4 session. The next hop for the IPv6 prefixes can be set through a
nexthop policy. In the event that the policy is not configured, the nexthops are set as the IPv6 address of the
peering interface (IPv6 neighbor interface or IPv6 update source interface, if any one of the interfaces is
configured).
If the nexthop policy is not configured and neither the IPv6 neighbor interface nor the IPv6 update source
interface is configured, the next hop is the IPv4 mapped IPv6 address.
Scoped IPv4/VPNv4 Table Walk
To determine which address family to process, a next-hop notification is received by first de-referencing the
gateway context associated with the next hop, then looking into the gateway context to determine which
address families are using the gateway context. The IPv4 unicast and VPNv4 unicast address families share
the same gateway context, because they are registered with the IPv4 unicast table in the RIB. As a result, both
the global IPv4 unicast table and the VPNv4 table are is processed when an IPv4 unicast next-hop notification
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
140
Implementing BGP
BGP Nonstop Routing Reference
is received from the RIB. A mask is maintained in the next hop, indicating if whether the next hop belongs
to IPv4 unicast or VPNv4 unicast, or both. This scoped table walk localizes the processing in the appropriate
address family table.
Reordered Address Family Processing
The software walks address family tables based on the numeric value of the address family. When a next-hop
notification batch is received, the order of address family processing is reordered to the following order:
• IPv4 tunnel
• VPNv4 unicast
• VPNv6 unicast
• IPv4 labeled unicast
• IPv4 unicast
• IPv4 MDT
• IPv6 unicast
• IPv6 labeled unicast
• IPv4 tunnel
• VPNv4 unicast
• IPv4 unicast
• IPv6 unicast
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
141
Implementing BGP
BGP Nonstop Routing Reference
Note BGP NSR is enabled by default. Use the nsr disable command to turn off BGP
NSR. The no nsr disable command can also be used to turn BGP NSR back on
if it has been disabled.
In case of process crash or process failure, NSR will be maintained only if nsr
process-failures switchover command is configured. In the event of process
failures of active instances, the nsr process-failures switchover configures
failover as a recovery action and switches over to a standby route processor (RP)
or a standby distributed route processor (DRP) thereby maintaining NSR. An
example of the configuration command is RP/0/RSP0/CPU0:router(config) # nsr
process-failures switchover
The nsr process-failures switchover command maintains both the NSR and
BGP sessions in the event of a BGP or TCP process crash. Without this
configuration, BGP neighbor sessions flap in case of a BGP or TCP process crash.
This configuration does not help if the BGP or TCP process is restarted in which
case the BGP neighbors are expected to flap.
When the l2vpn_mgr process is restarted, the NSR client (te-control) flaps between
the Ready and Not Ready state. This is the expected behavior and there is no
traffic loss.
During route processor switchover and In-Service System Upgrade (ISSU), NSR is achieved by stateful
switchover (SSO) of both TCP and BGP.
NSR does not force any software upgrades on other routers in the network, and peer routers are not required
to support NSR.
When a route processor switchover occurs due to a fault, the TCP connections and the BGP sessions are
migrated transparently to the standby route processor, and the standby route processor becomes active. The
existing protocol state is maintained on the standby route processor when it becomes active, and the protocol
state does not need to be refreshed by peers.
Events such as soft reconfiguration and policy modifications can trigger the BGP internal state to change. To
ensure state consistency between active and standby BGP processes during such events, the concept of post-it
is introduced that act as synchronization points.
BGP NSR provides the following features:
• NSR-related alarms and notifications
• Configured and operational NSR states are tracked separately
• NSR statistics collection
• NSR statistics display using show commands
• XML schema support
• Auditing mechanisms to verify state synchronization between active and standby instances
• CLI commands to enable and disable NSR
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
142
Implementing BGP
BGP Route Reflectors Reference
Along with route reflector-aware BGP speakers, it is possible to have BGP speakers that do not understand
the concept of route reflectors. They can be members of either client or nonclient groups, allowing an easy
and gradual migration from the old BGP model to the route reflector model. Initially, you could create a single
cluster with a route reflector and a few clients. All other iBGP speakers could be nonclient peers to the route
reflector and then more clusters could be created gradually.
An autonomous system can have multiple route reflectors. A route reflector treats other route reflectors just
like other iBGP speakers. A route reflector can be configured to have other route reflectors in a client group
or nonclient group. In a simple configuration, the backbone could be divided into many clusters. Each route
reflector would be configured with other route reflectors as nonclient peers (thus, all route reflectors are fully
meshed). The clients are configured to maintain iBGP sessions with only the route reflector in their cluster.
Usually, a cluster of clients has a single route reflector. In that case, the cluster is identified by the router ID
of the route reflector. To increase redundancy and avoid a single point of failure, a cluster might have more
than one route reflector. In this case, all route reflectors in the cluster must be configured with the cluster ID
so that a route reflector can recognize updates from route reflectors in the same cluster. All route reflectors
serving a cluster should be fully meshed and all of them should have identical sets of client and nonclient
peers.
By default, the clients of a route reflector are not required to be fully meshed and the routes from a client are
reflected to other clients. However, if the clients are fully meshed, the route reflector need not reflect routes
to clients.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
143
Implementing BGP
iBGP Multipath Load Sharing Reference
As the iBGP learned routes are reflected, routing information may loop. The route reflector model has the
following mechanisms to avoid routing loops:
• Originator ID is an optional, nontransitive BGP attribute. It is a 4-byte attributed created by a route
reflector. The attribute carries the router ID of the originator of the route in the local autonomous system.
Therefore, if a misconfiguration causes routing information to come back to the originator, the information
is ignored.
• Cluster-list is an optional, nontransitive BGP attribute. It is a sequence of cluster IDs that the route has
passed. When a route reflector reflects a route from its clients to nonclient peers, and vice versa, it appends
the local cluster ID to the cluster-list. If the cluster-list is empty, a new cluster-list is created. Using this
attribute, a route reflector can identify if routing information is looped back to the same cluster due to
misconfiguration. If the local cluster ID is found in the cluster-list, the advertisement is ignored.
Even if the criteria are met and multiple paths are considered multipaths, the BGP speaking router designates
one of the multipaths as the best path and advertises this best path to its neighbors.
Note • Overwriting of next-hop calculation for multipath prefixes is not allowed. The next-hop-unchanged
multipath command disables overwriting of next-hop calculation for multipath prefixes.
• The ability to ignore as-path onwards while computing multipath is added. The bgp multipath as-path
ignore onwards command ignores as-path onwards while computing multipath.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
144
Implementing BGP
MPLS VPN Carrier Supporting Carrier
The neighbor internal-vpn-client command enables PE devices to make an entire VPN cloud act as an
internal VPN client to the CE devices. These CE devices are connected internally to the VPN cloud through
the iBGP PE-CE connection inside the VRF. After this connection is established, the PE device encapsulates
the CE-learned path into an attribute called ATTR_SET and carries it in the iBGP-sourced path throughout
the VPN core to the remote PE device. At the remote PE device, this attribute is assigned with individual
attributes and the source CE path is extracted and sent to the remote CE devices.
ATTR_SET is an optional transitive attribute that carries the CE path attributes received. The ATTR_SET
attribute is encoded inside the BGP update message as follows:
+------------------------------+
| Attr Flags (O|T) Code = 128 |
+------------------------------+
| Attr. Length (1 or 2 octets) |
+------------------------------+
| Origin AS (4 octets) |
+------------------------------+
| Path attributes (variable) |
+------------------------------+
Origin AS is the AS of the VPN customer for which the ATTR_SET is generated. The minimum length of
ATTR_SET is four bytes and the maximum is the maximum supported for a path attribute after taking into
consideration the mandatory fields and attributes in the BGP update message. It is recommended that the
maximum length is limited to 3500 bytes. ATTR_SET must not contain the following attributes: MP_REACH,
MP_UNREACH, NEW_AS_PATH, NEW_AGGR, NEXT_HOP and ATTR_SET itself (ATTR_SET inside
ATTR_SET). If these attributes are found inside the ATTR_SET, the ATTR_SET is considered invalid and
the corresponding error handling mechanism is invoked.
You can configure a CSC network to enable BGP to transport routes and MPLS labels between the backbone
carrier provider edge (PE) routers and the customer carrier customer edge (CE) routers using multiple paths.
The benefits of using BGP to distribute IPv4 routes and MPLS label routes are:
• BGP takes the place of an Interior Gateway Protocol (IGP) and Label Distribution Protocol (LDP) in a
VPN routing and forwarding (VRF) table. You can use BGP to distribute routes and MPLS labels. Using
a single protocol instead of two simplifies the configuration and troubleshooting.
• BGP is the preferred routing protocol for connecting two ISPs, mainly because of its routing policies
and ability to scale. ISPs commonly use BGP between two providers. This feature enables those ISPs to
use BGP.
For detailed information on configuring MPLS VPN CSC with BGP, see the Implementing MPLS Layer 3
VPNs on module of the MPLS Configuration Guide.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
145
Implementing BGP
Per VRF and Per CE Label for IPv6 Provider Edge
For more information on IPv6 unicast addressing, refer the IP Addresses and Services Configuration Guide.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
146
Implementing BGP
BGP Update Message Error Handling
• The remove-private-as command removes private AS numbers from the AS path even if the path contains
both public and private ASNs.
• The remove-private-as command removes private AS numbers even if the AS path contains only private
AS numbers. There is no likelihood of a 0-length AS path because this command can be applied to eBGP
peers only, in which case the AS number of the local router is appended to the AS path.
• The remove-private-as command removes private AS numbers even if the private ASNs appear before
the confederation segments in the AS path.
• The replace-as command replaces the private AS numbers being removed from the path with the local
AS number, thereby retaining the same AS path length.
The feature can be applied to neighbors per address family (address family configuration mode). Therefore,
you can apply the feature for a neighbor in one address family and not on another, affecting update messages
on the outbound side for only the address family for which the feature is configured.
Use show bgp neighbors and show bgp update-group commands to verify that the that private AS numbers
were removed or replaced.
This is a sample BGP attribute filtering syslog message for the "discard attribute" action:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
147
Implementing BGP
BGP-RIB Feedback Mechanism for Update Generation
This is a sample BGP attribute filtering syslog message for the "treat-as-withdraw" action:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
148
CHAPTER 2
EVPN Virtual Private Wire Service (VPWS)
The EVPN-VPWS is a BGP control plane solution for point-to-point services. It implements the signaling
and encapsulation techniques for establishing an EVPN instance between a pair of PEs. It has the ability to
forward traffic from one network to another without MAC lookup. The use of EVPN for VPWS eliminates
the need for signaling single-segment and multi-segment PWs for point-to-point Ethernet services.
EVPN-VPWS single homed technology works on IP and MPLS core; IP core to support BGP and MPLS core
for switching packets between the endpoints.
Note Other than enabling RTC (route target constraint) with address-family ipv4 rtfilter command, there is
no separate configuration needed to enable RTC for BGP EVPN.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
149
EVPN Virtual Private Wire Service (VPWS)
Configuring L2VPN EVPN Address Family Under BGP
• The VPWS service on PE1 requires the following three elements to be specified at configuration time:
• The VPN ID (EVI)
• The local AC identifier (AC1) that identifies the local end of the emulated service.
• The remote AC identifier (AC2) that identifies the remote end of the emulated service.
Note Other than enabling RTC (route target constraint) with address-family ipv4 rtfilter command, there is
no separate configuration needed to enable RTC for BGP EVPN.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
150
EVPN Virtual Private Wire Service (VPWS)
Configuring EVPN-VPWS
Example:
Specifies the L2VPN address family and enters address family configuration mode.
Specifies the L2VPN address family of the neighbor and enters address family configuration mode.
Configuring EVPN-VPWS
Perform this task to configure EVPN-VPWS.
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Step 2 l2vpn
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
151
EVPN Virtual Private Wire Service (VPWS)
Configuring EVPN-VPWS: Example
RP/0/RP0/CPU0:router(config)# l2vpn
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
152
EVPN Virtual Private Wire Service (VPWS)
Configuring EVPN-VPWS: Example
RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# l2vpn
RP/0/RP0/CPU0:router(config-l2vpn)# xconnect group evpn-vpws
RP/0/RP0/CPU0:router(config-l2vpn-xc)# p2p evpn1
RP/0/RP0/CPU0:router(config-l2vpn-xc-p2p)# interface TenGigE0/1/0/12
RP/0/RP0/CPU0:router(config-l2vpn-xc-p2p)# neighbor evpn evi 100 target 12 source 10
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
153
EVPN Virtual Private Wire Service (VPWS)
Configuring EVPN-VPWS: Example
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
154
CHAPTER 3
BGP-based VPWS Autodiscovery
An important aspect of VPN technologies is the ability of network devices to automatically signal to other
devices about an association with a particular VPN. Autodiscovery refers to the process of finding all the
provider edge routers that participates in a given VPWS instance.
The two primary functions of the VPWS control plane are: auto-discovery and signaling. Both of these
functions are accomplished with a single BGP Update advertisement.
When a VPWS cross-connect is configured with BGP auto-discovery and signaling enabled, BGP needs to
distribute NLRI for the xconnect with the PE as the BGP next-hop and appropriate CE-ID. Additionally, the
cross-connect is associated with one or more BGP export Route Targets (RTs) that are also distributed (along
with NLRI).
• Configuring VPWS with BGP Autodiscovery and Signaling, on page 155
• VPWS with BGP Autodiscovery and BGP Signaling, on page 157
Procedure
Step 1 configure
Example:
RP/0/RP0/CPU0:router# configure
Step 2 l2vpn
Example:
RP/0/RP0/CPU0:router(config)# l2vpn
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
155
BGP-based VPWS Autodiscovery
Configuring VPWS with BGP Autodiscovery and Signaling
Example:
RP/0/RP0/CPU0:router(config-l2vpn-xc-mp2mp)#l2-encapsulation vlan
RP/0/RP0/CPU0:router(config-l2vpn-xc-mp2mp)#autodiscovery bgp
Enters BGP autodiscovery configuration mode where all BGP autodiscovery parameters are configured.
RP/0/RP0/CPU0:router(config-l2vpn-xc-mp2mp-ad)# rd auto
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
156
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
Enables BGP signaling, and enters the BGP signaling configuration submode where BGP signaling parameters
are configured.
RP/0/RP0/CPU0:router(config-l2vpn-xc-mp2mp-ad-sig)# ce-id 10
Configuration at PE1:
l2vpn
xconnect group gr1
mp2mp mp1
vpn-id 100
l2 encapsulation vlan
autodiscovery bgp
rd auto
route-target 2.2.2.2:100
! Signaling attributes
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
157
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
signaling-protocol bgp
ce-id 1
interface GigabitEthernet0/1/0/1.1 remote-ce-id 2
Configuration at PE2:
l2vpn
xconnect group gr1
mp2mp mp1
vpn-id 100
l2 encapsulation vlan
autodiscovery bgp
rd auto
route-target 2.2.2.2:100
! Signaling attributes
signaling-protocol bgp
ce-id 2
interface GigabitEthernet0/1/0/2.1 remote-ce-id 1
Verification:
PE1:
PE1# show l2vpn discovery xconnect
Status Vector: 9f ff
Status Vector: 7f ff
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
158
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
L2 Encapsulation: VLAN
2.2.2.2:100
2.2.2.2:100
Signaling protocol:BGP
CE Range:10
….
CE-ID 1 2
...
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
159
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
i - internal, S stale
PE2:
PE2# show l2vpn discovery xconnect
Status Vector: 7f ff
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
160
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
Status Vector: 7f ff
Status Vector: 9f ff
L2 Encapsulation: VLAN
2.2.2.2:100
2.2.2.2:100
Signaling protocol:BGP
CE Range:10
...
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
161
BGP-based VPWS Autodiscovery
VPWS with BGP Autodiscovery and BGP Signaling
CE-ID 2 1
...
i - internal, S stale
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
162
CHAPTER 4
BGP Dynamic Neighbors
Earlier, IOS-XR supported explicitly configured or static neighbor configuration. BGP dynamic neighbor
support allows BGP peering to a group of remote neighbors that are defined by a range of IP addresses. Each
range can be configured as a subnet IP address.
In larger BGP networks, implementing BGP dynamic neighbors can reduce the amount and complexity of
CLI configuration and save CPU and memory usage. Both IPv4 and IPv6 peering are supported.
• Configuring BGP Dynamic Neighbors using Address Range, on page 163
• Configuring BGP Dynamic Neighbors Using Address Range With Authentication, on page 164
• Maximum-peers and Idle-watch timeout, on page 165
Configuration
Router# configure
Router(config)# router bgp as-number
Router(config-bgp)# neighbor address prefix
Router(config-bgp-nbr)# remote-as as-number
Router(config-bgp-nbr)# update-source interface
Router(config-bgp-nbr)# address-family ipv4 unicast
Router# commit
Running Configuration
Router# show running-config router bgp
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
163
BGP Dynamic Neighbors
Configuring BGP Dynamic Neighbors Using Address Range With Authentication
!
neighbor 12.12.12.0/24
remote-as 100
update-source TenGigE0/11/0/5
address-family ipv4 unicast
!
!
!
Running Configuration
Router# show running-config router bgp
Configuring EA Authentication
The following task shows how to configure the EA authentication.
Note Configuring EA authentication is a prerequisite for configuring BGP dynamic neighbors with EA authentication.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
164
BGP Dynamic Neighbors
Maximum-peers and Idle-watch timeout
The following task shows how to configure BGP dynamic neighbors using address range with EA authentication.
Router# configure
Router(config)# router bgp as-number
Router(config-bgp)# neighbor address prefix
Router(config-bgp-nbr)# remote-as as-number
Router(config-bgp-nbr)# keychain bgp_ea
Router(config-bgp-nbr)# address-family ipv4 unicast
Router(config-bgp-nbr)# route-policy name
Router(config-bgp-nbr)# route-policy name
Router# commit
Running Configuration
Running Configuration
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
165
BGP Dynamic Neighbors
Maximum-peers and Idle-watch timeout
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
166
CHAPTER 5
BGP Prefix Independent Convergence
Restrictions:
• Ensure that the Border Gateway Protocol (BGP) and the IP or Multiprotocol Label Switching (MPLS)
network is up and running at the customer site that is connected to the provider site by more than one
path (multihomed).
• Ensure that the backup or alternate path has a unique next hop that is not the same as the next hop of the
best path.
• As a best practice, enable the Bidirectional Forwarding Detection (BFD) protocol to quickly detect link
failures.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
167
BGP Prefix Independent Convergence
Configure BGP PIC
By default, without primary and backup path installation in the hardware, IPv4, IPv6, 6PE (per-vrf), 6VPE
(per-vrf/per-ce), L3VPN (per-vrf/per-ce) has good convergence.
When the mode is a per-prefix by default, BGP-PIC does not give good convergence, hence you must do
hardware-assisted PIC. For this, configure the cef encap-sharing disable command in XR Config mode.
With hardware-assisted BGP PIC that is configured using the cef encap-sharing disable command, separate
hardware resources (FEC/EEDB) are allocated for every prefix. Cisco recommends you to make sure that the
router has sufficient hardware resources for the resource allocation.
Caution This CLI reprograms the CEF completely and impacts traffic. We recommend that you do it in the
maintenance window.
Specifies the autonomous system number and enters the BGP configuration mode, allowing you to configure
the BGP routing process.
Step 3 address-family {vpnv4 unicast | vpnv6 unicast | ipv4 unicast | ipv6 unicast}
Example:
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
168
BGP Prefix Independent Convergence
Configure BGP PIC Multipath
route-policy ap1
set path-selection backup 1 install
end-policy
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
169
BGP Prefix Independent Convergence
Configure BGP PIC Multipath
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
170
CHAPTER 6
Master Key Tuple Configuration
This feature specifies TCP Authentication Option (TCP-AO), which replaces the TCP MD5 option. TCP-AO
uses the Message Authentication Codes (MACs), which provides the following:
• Protection against replays for long-lived TCP connections
• More details on the security association with TCP connections than TCP MD5
• A larger set of MACs with minimal other system and operational changes
TCP-AO is compatible with Master Key Tuple (MKT) configuration. TCP-AO also protects connections
when using the same MKT across repeated instances of a connection. TCP-AO protects the connections by
using traffic key that are derived from the MKT, and then coordinates changes between the endpoints.
Note TCPAO and TCP MD5 are never permitted to be used simultaneously. TCP-AO supports IPv6, and is fully
compatible with the proposed requirements for the replacement of TCP MD5.
The system translates each key, such “key_id” that is under a keychain, as MKT. The keychain configuration
owns part of the configuration like secret, lifetimes, and algorithms. While the “tcp ao keychain” mode owns
the TCP AO-specific configuration for an MKT (send_id and receive_id).
• Keychain Configurations, on page 171
Keychain Configurations
Configuration Guidelines
In order to run a successful configuration, ensure that you follow the configuration guidelines:
• An allowed value range for both Send_ID and Receive_ID is 0 to 255.
• You can link only one keychain to an application neighbor.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
171
Master Key Tuple Configuration
Configuration Guidelines for TCP AO BGP Neighbor
• Under the same keychain, if you configure the same send_id key again under the keys that have an
overlapping lifetime, then the old key becomes unusable until you correct the configuration.
• The system sends a warning message in the following scenarios:
• If there is a change in Send_ID or Receive_ID.
• If the corresponding key is currently active, and is in use by some connection.
Note If you configure one of these options, the system rejects the other authentication
options during the configuration time.
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
172
Master Key Tuple Configuration
Keychain Configuration
• TCP does not have any restriction on the number of keychains and keys under a keychain. The system
does not support more than 4000 keychains, any number higher than 4000 might result in unexpected
behaviors.
Keychain Configuration
key chain <keychain_name>
key <key_id>
accept-lifetime <start-time> <end-time>
key-string <master-key>
send-lifetime <start-time> <end-time>
cryptographic-algorithm <algorithm>
!
!
TCP Configuration
TCP provides a new tcp ao submode that specifies SendID and ReceiveID per key_id per keychain.
tcp ao
keychain <keychain_name1>
key-id <key_id> send_id <0-255> receive_id <0-255>
!
Example:
tcp ao
keychain bgp_ao
key 0 SendID 0 ReceiveID 0
key 1 SendID 1 ReceiveID 1
key 2 SendID 3 ReceiveID 4
!
keychain ldp_ao
key 1 SendID 100 ReceiveID 200
key 120 SendID 1 ReceiveID 1
!
BGP Configurations
Applications like BGP provide the tcp-ao keychain and related information that it uses per neighbor. Following
are the optional configurations per tcp-ao keychain:
• include-tcp-options
• accept-non-ao-connections
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
173
Master Key Tuple Configuration
XML Configurations
XML Configurations
BGP XML
TCP-AO XML
<?xml version="1.0" encoding="UTF-8"?>
<Request>
<Set>
<Configuration>
<IP_TCP>
<AO>
<Enable>
true
</Enable>
<KeychainTable>
<Keychain>
<Naming>
<Name> bgp_ao_xml </Name>
</Naming>
<Enable>
true
</Enable>
<KeyTable>
<Key>
<Naming>
<KeyID> 0 </KeyID>
</Naming>
<SendID> 0 </SendID>
<ReceiveID> 0 </ReceiveID>
</Key>
</KeyTable>
</Keychain>
</KeychainTable>
</AO>
</IP_TCP>
</Configuration>
</Set>
<Commit/>
</Request>
Verification
To verify the keychain database, use the show tcp authentication keychain <keychain-name> command in
EXEC mode. The following output displays all the keychain database details:
Keychain name: tcp_ao_keychain1, configured for tcp-ao
Desired key: 1
Detail of last notification from keychain:
Time: 'Jan 23 12:07:39.128', event: Config update, attr: Crypto algorithm, key: 1
Total number of keys: 1
Key details:
Key ID: 1, Active, Valid
Active_state: 1, invalid_bits: 0x0, state: 0x110
Key is configured for tcp-ao, Send ID: 1, Receive ID: 1
Crypto algorithm: AES_128_CMAC_96, key string chksum: 00028222
Detail of last notification from keychain:
Time: 'Jan 23 12:07:39.128', event: Config update, attr: Crypto algorithm
No valid overlapping key
No keys invalidated
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
174
Master Key Tuple Configuration
Verification
Peer: 0x7fc2f0024618,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc2f00247f8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc2f00249d8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc2f0024bb8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc320037a08,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc320037d78,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc3200386d8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc3200388b8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc320038a98,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc35000d3f8,
Current key: 1
Traffic keys: send_non_SYN: 00476017, recv_non_SYN: ffd520f9
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:41.953, reason: Peer requested rollover
Peer: 0x7fc320038e78,
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
175
Master Key Tuple Configuration
Verification
Peer: 0x7fc350012758,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc2f0026bc8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Peer: 0x7fc320048b08,
Current key: 1
Traffic keys: send_non_SYN: 004a05b5, recv_non_SYN: fff639b2
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:44.209, reason: No current key set
Peer: 0x7fc2f4008388,
Current key: 1
Traffic keys: send_non_SYN: 0029837c, recv_non_SYN: 002af030
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:44.229, reason: No current key set
Peer: 0x7fc350017198,
Current key: 1
Traffic keys: send_non_SYN: ffdb7322, recv_non_SYN: fff1fb23
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:45.419, reason: Peer requested rollover
Peer: 0x7fc320049098,
Current key: 1
Traffic keys: send_non_SYN: ffed0d67, recv_non_SYN: ffe4f959
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:55.180, reason: No current key set
Peer: 0x7fc32005d2a8,
Current key: 1
Traffic keys: send_non_SYN: 0021b461, recv_non_SYN: fffe679e
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:56.894, reason: No current key set
Peer: 0x7fc350035c88,
Current key: 1
Traffic keys: send_non_SYN: 00296167, recv_non_SYN: fff1c236
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:07:57.859, reason: Peer requested rollover
Peer: 0x7fc35003fb18,
Current key: 1
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
176
Master Key Tuple Configuration
Verification
Peer: 0x7fc350049638,
Current key: 1
Traffic keys: send_non_SYN: 002ff48b, recv_non_SYN: ffbe71b9
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:08:10.014, reason: Peer requested rollover
Peer: 0x7fc350053928,
Current key: 1
Traffic keys: send_non_SYN: 00206914, recv_non_SYN: 001df9bc
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
Last 1 keys used:
key: 1, time: Jan 23 12:08:12.422, reason: Peer requested rollover
Peer: 0x7fc2f401f3b8,
Current key not yet available
RNext key: 1
Traffic keys: send_non_SYN: 00000000, recv_non_SYN: 00000000
RP/0/RP0/CPU0:stoat#
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
177
Master Key Tuple Configuration
Verification
BGP Configuration Guide for Cisco NCS 540 Series Routers, IOS XR Release 7.4.x
178