Introduction
This document describes the purpose of the dampen-igp-metric command in Border Gateway Protocol (BGP) on Cisco Nexus family of Switches which run the NX-OS Operating System.
Prerequisites
Requirements
Cisco recommends that you have knowledge of these topics:
- Nexus NX-OS Software.
- BGP Routing Protocol.
Components Used
The information in this document is based on these software and hardware versions:
- Cisco N9K-C9508
- NXOS version 7.0(3)I7(6)
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Configure
By default, the Nexus Family of Switches have the command dampen-igp-metric set to its default value of 600 seconds in the BGP configuration section.
This affects how BGP handles Interior Gateway Protocols (IGP) metric changes reported for redistributed routes. BGP dampens these changes as it process them in a batched fashion with a 10 minute delay.
This command allows you to adjust that delay or remove it altogether for quicker response to these changes.
The BGP MED (Multi Exit Discriminator) attribute is updated with the new cost of the redistributed IGP route once the timer expires.
Nexus - Nexus NX-OS |
Nexus# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Nexus(config)# router bgp 65535
Nexus(config-router)# address-family ipv4 unicast
Nexus(config-router-af)# dampen-igp-metric ?
<20-3600> Time interval in seconds
*Default value is 600
Nexus(config-router-af)# no dampen-igp-metric
|
This command can likewise be configured for address-family ipv6 unicast and per VRF instances in the BGP configuration section.
Note: The command dampen-igp-metric also controls the delay time to update other BGP attributes like the Next-hop attribute when IGP routes are leaked into other VRFs with the use of BGP.
Network Diagram
In this scenario,the Nexus Switch has been configured to redistribute Open Shortest Path First (OSPF) routes from the Routing Table into the BGP table.
Configurations
R1 - Cisco IOS |
configure terminal
!
hostname R1
!
router ospf 1
router-id 10.255.255.1
!
interface Loopback0
ip address 10.255.255.1 255.255.255.255
ip ospf 1 area 0
!
interface GigabitEthernet0/0
ip address 10.1.2.1 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0 no shutdown
!
end
|
Nexus - NX-OS |
configure terminal ! hostname Nexus ! feature ospf feature bgp
! route-map ALL !
router ospf 1
router-id 10.255.255.2
!
router bgp 65535
router-id 10.255.255.2
address-family ipv4 unicast
redistribute ospf 1 route-map ALL
neighbor 10.2.3.3
remote-as 65535
address-family ipv4 unicast
! interface Ethernet1/1 ip address 10.1.2.2/24 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown
!
interface Ethernet1/2
ip address 10.2.3.2/24
no shutdown
|
R3 - Cisco IOS |
configure terminal
!
hostname R3
!
router bgp 65535
bgp log-neighbor-changes
neighbor 10.2.3.2 remote-as 65535
!
interface GigabitEthernet0/0
ip address 10.2.3.3 255.255.255.0
no shutdown
!
end
|
Verify
Run the command show bgp internal af. Ensure the line IGP Metric Dampening Interval indicates the desired value.
Default value is 600 (seconds).
Nexus - NX-OS |
Nexus# show bgp internal af
. . .
BGP Address Family Information for VRF: default
Import Pending : No
Import Pending : never
Import Pending Reset : never
Table Context Address : 0xcfa08bf4
Address family: IPv4 Unicast
. . .
IGP Metric Dampening Interval : 600
|
In the event that the OSPF route in the Routing Table updates its Cost, there is a delay to reflect this new value in the BGP MED path attribute.
Nexus - NX-OS |
Nexus# show ip route 10.255.255.1
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
10.255.255.1/32, ubest/mbest: 1/0
*via 10.1.2.1, Eth1/1, [110/41], 01:58:41, ospf-1, intra
Nexus#
* There is an update in the Cost of the OSPF route 10.255.255.1/32
Nexus# show ip route 10.255.255.1
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
10.255.255.1/32, ubest/mbest: 1/0
*via 10.1.2.1, Eth1/1, [110/190], 00:00:02, ospf-1, intra
Nexus#
Nexus# show bgp ipv4 unicast
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 4, Local Router ID is 10.255.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-i
njected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup
Network Next Hop Metric LocPrf Weight Path
*>r10.255.255.1/32 0.0.0.0 41 100 32768 ?
Nexus#
* After 600 seconds.
Nexus# show bgp ipv4 unicast
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 5, Local Router ID is 10.255.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-i
njected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup
Network Next Hop Metric LocPrf Weight Path
*>r10.255.255.1/32 0.0.0.0 190 100 32768 ?
|
Run the command no dampen-igp-metric under BGP address-family configuration section to immediately update the MED attribute in the BGP table upon a OSPF Cost change in the Routing Table.
Nexus - NX-OS |
Nexus# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Nexus(config)# router bgp 65535
Nexus(config-router)# address-family ipv4 unicast
Nexus(config-router-af)# no dampen-igp-metric
* There is an update in the Cost of the OSPF route 10.255.255.1/32
Nexus# show ip route 10.255.255.1
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
10.255.255.1/32, ubest/mbest: 1/0
*via 10.1.2.1, Eth1/1, [110/190], 00:00:02, ospf-1, intra
Nexus# show ip bgp
BGP routing table information for VRF default, address family IPv4 Unicast
BGP table version is 7, Local Router ID is 10.255.255.2
Status: s-suppressed, x-deleted, S-stale, d-dampened, h-history, *-valid, >-best
Path type: i-internal, e-external, c-confed, l-local, a-aggregate, r-redist, I-i
njected
Origin codes: i - IGP, e - EGP, ? - incomplete, | - multipath, & - backup
Network Next Hop Metric LocPrf Weight Path
*>r10.255.255.1/32 0.0.0.0 190 100 32768 ?
|
Troubleshoot
In order to confirm the functionality of the dampen-igp-metric command on NX-OS, turn on the next debugs.
- debug-filter bgp prefix <PREFIX/MASK>
- debug logfile <FILE_NAME>
- debug bgp dampening brib
Nexus - NX-OS |
Nexus# debug-filter bgp prefix 10.255.255.1/32
Nexus# debug logfile bgpdebug.log
Nexus# debug bgp dampening brib
Nexus#
Nexus# show debug logfile bgpdebug.log 2019 Jul 23 21:13:27.676328 bgp: [25368] (default) BRIB: [IPv4 Unicast] Setting the update pending flag for 10.255.255.1/32 Nexus# show debug logfile bgpdebug.log 2019 Jul 23 21:13:27.676328 bgp: [25368] (default) BRIB: [IPv4 Unicast] Setting the update pending flag for 10.255.255.1/32 2019 Jul 23 21:20:47.641987 bgp: [25368] (default) BRIB: [IPv4 Unicast] Clearing the update pending flag for 10.255.255.1/32 2019 Jul 23 21:20:47.642013 bgp: [25368] (default) BRIB: [IPv4 Unicast] Originating prefix 10.255.255.1/32, route type redist 2019 Jul 23 21:20:47.642075 bgp: [25368] (default) BRIB: [IPv4 Unicast] Installing prefix 10.255.255.1/32 (redist) via 0.0.0.0 (0x0/0x0) into BRIB with extcomm Extcommunity: OSPF RT:0.0.0.0:0:0 2019 Jul 23 21:20:47.642395 bgp: [25368] (default) BRIB: [IPv4 Unicast] Path to 10.255.255.1/32 via 0.0.0.0 already exists, dflags=0x80002 2019 Jul 23 21:20:47.642415 bgp: [25368] (default) BRIB: [IPv4 Unicast] (10.255.255.1/32 (local)): bgp_brib_add: handling nexthop, path->flags2: 0x1 2019 Jul 23 21:20:47.642447 bgp: [25368] (default) BRIB: [IPv4 Unicast] (10.255.255.1/32 (local)): returning from bgp_brib_add, reeval=0new_path: 0, change: 1, undelete: 0, history: 0, force: 0, (pflags=0x2408) rnh_flag_change 0 2019 Jul 23 21:20:47.642475 bgp: [25368] (default) BRIB: [IPv4 Unicast] Cleanup for dest 10.255.255.1/32 exits since it's on newlist Nexus#
|
Once done, disable the debugs with the next commands:
- undebug all
- no debug-filter all
- clear debug logfile <FILE_NAME>