Examples: Configuring BGP Flap Damping
Understanding Damping Parameters
BGP route flapping describes the situation in which BGP systems send an excessive number of update messages to advertise network reachability information. BGP flap damping is a method of reducing the number of update messages sent between BGP peers, thereby reducing the load on these peers, without adversely affecting the route convergence time for stable routes.
Flap damping reduces the number of update messages by marking routes as ineligible for selection as the active or preferable route. Marking routes in this way leads to some delay, or suppression, in the propagation of route information, but the result is increased network stability. You typically apply flap damping to external BGP (EBGP) routes (routes in different ASs). You can also apply flap damping within a confederation, between confederation member ASs. Because routing consistency within an AS is important, do not apply flap damping to internal BGP (IBGP) routes. (If you do, it is ignored.)
There is an exception that rule. Starting in Junos OS Release 12.2, you can apply flap damping at the address family level. In a Junos OS Release 12.2 or later installation, when you apply flap damping at the address family level, it works for both IBGP and EBGP.
By default, route flap damping is not enabled. Damping is applied to external peers and to peers at confederation boundaries.
When you enable damping, default parameters are applied, as summarized in Table 1.
Table 1: Damping Parameters
Damping Parameter | Description | Default Value | Possible Values |
---|---|---|---|
half-life minutes | Decay half-life—Number of minutes after which an arbitrary value is halved if a route stays stable. | 15 (minutes) | 1 through 45 |
max-suppress minutes | Maximum hold-down time for a route, in minutes. | 60 (minutes) | 1 through 720 |
reuse | Reuse threshold—Arbitrary value below which a suppressed route can be used again. | 750 | 1 through 20,000 |
suppress | Cutoff (suppression) threshold—Arbitrary value above which a route can no longer be used or included in advertisements. | 3000 | 1 through 20,000 |
To change the default BGP flap damping values, you define actions by creating a named set of damping parameters and including it in a routing policy with the damping action. For the damping routing policy to work, you also must enable BGP route flap damping.
Example: Configuring BGP Route Flap Damping Parameters
This example shows how to configure damping parameters.
Requirements
Before you begin, configure router interfaces and configure routing protocols.
Overview
This example has three routing devices. Device R2 has external BGP (EBGP) connections with Device R1 and Device R3.
Device R1 and Device R3 have some static routes configured for testing purposes, and these static routes are advertised through BGP to Device R2.
Device R2 damps routes received from Device R1 and Device R3 according to these criteria:
Damp all prefixes with a mask length equal to or greater than 17 more aggressively than routes with a mask length between 9 and 16.
Damp routes with a mask length between 0 and 8, inclusive, less than routes with a mask length greater than 8.
Do not damp the 10.128.0.0/9 prefix at all.
The routing policy is evaluated when routes are being exported from the routing table into the forwarding table. Only the active routes are exported from the routing table.
Figure 1 shows the sample network.

CLI Quick Configuration shows the configuration for all of the devices in Figure 1.
The section Step-by-Step Procedure describes the steps on Device R2.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Device R1
Device R2
Device R3
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure damping parameters:
Configure the interfaces.
content_copy zoom_out_map[edit interfaces]user@R2# set fe-1/2/0 unit 0 family inet address 10.0.0.2/30user@R2# set fe-1/2/1 unit 0 family inet address 10.1.0.1/30user@R2# set lo0 unit 0 family inet address 192.168.0.2/32- Configure the BGP neighbors.content_copy zoom_out_map[edit protocols bgp group ext]user@R2# set type externaluser@R2# set neighbor 10.0.0.1 peer-as 100user@R2# set neighbor 10.1.0.2 peer-as 300
Create and configure the damping parameter groups.
content_copy zoom_out_map[edit policy-options]user@R2# set damping aggressive half-life 30user@R2# set damping aggressive suppress 2500user@R2# set damping timid half-life 5user@R2# set damping dry disableConfigure the damping policy.
content_copy zoom_out_map[edit policy-options policy-statement damp term 1]user@R2# set from route-filter 10.128.0.0/9 exact damping dryuser@R2# set from route-filter 0.0.0.0/0 prefix-length-range /0-/8 damping timiduser@R2# set from route-filter 0.0.0.0/0 prefix-length-range /17-/32 damping aggressiveEnable damping for BGP.
content_copy zoom_out_map[edit protocols bgp]user@R2# set dampingApply the policy as an import policy for the BGP neighbor.
content_copy zoom_out_map[edit protocols bgp group ext]user@R2# set import dampNoteYou can refer to the same routing policy one or more times in the same or different import statements.
- Configure an export policy.content_copy zoom_out_map[edit policy-options policy-statement send-direct term 1]user@R2# set from protocol directuser@R2# set then accept
- Apply the export policy.content_copy zoom_out_map[edit protocols bgp group ext]user@R2# set export send-direct
- Configure the autonomous system (AS) number.content_copy zoom_out_map[edit routing-options]user@R2# set autonomous-system 200
Results
From configuration mode, confirm your configuration by issuing the show interfaces, show protocols, show policy-options, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
If you are done configuring the device, enter commit from configuration mode.
Verification
Confirm that the configuration is working properly.
Causing Some Routes to Flap
Purpose
To verify your route flap damping policy, some routes must flap. Having a live Internet feed almost guarantees that a certain number of route flaps will be present. If you have control over a remote system that is advertising the routes, you can modify the advertising router's policy to effect the advertisement and withdrawal of all routes or of a given prefix. In a test environment, you can cause routes to flap by clearing the BGP neighbors or by restarting the routing process on the BGP neighbors, as shown here.
Action
From operational mode on Device R1 and Device R3, enter the restart routing command.
Use this command cautiously in a production network.
user@R1> restart routing
R1 started, pid 10474
user@R3> restart routing
R3 started, pid 10478
Meaning
On Device R2, all of the routes from the neighbors are withdrawn and re-advertised.
Checking the Route Flaps
Purpose
View the number of neighbor flaps.
Action
From operational mode, enter the show bgp summary command.
user@R2> show bgp summary
Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending inet.0 12 1 11 0 11 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 10.0.0.1 100 10 10 0 4 2:50 0/9/0/9 0/0/0/0 10.1.0.2 300 10 10 0 4 2:53 1/3/1/2 0/0/0/0
Meaning
This output was captured after the routing process was restarted on Device R2’s neighbors four times.
Verifying Route Flap Damping
Purpose
Verify that routes are being hidden due to damping.
Action
From operational mode, enter the show route damping suppressed command.
user@R2> show route damping suppressed
inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) + = Active Route, - = Last Active, * = Both 0.0.0.0/0 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.0.0.0/9 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.0.0.0/30 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 10.1.0.0/30 [BGP ] 00:00:15, localpref 100 AS path: 300 I, validation-state: unverified > to 10.1.0.2 via fe-1/2/1.0 10.224.0.0/11 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.0.0/16 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.128.0/17 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 172.16.192.0/20 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 192.168.0.1/32 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0 192.168.0.3/32 [BGP ] 00:00:15, localpref 100 AS path: 300 I, validation-state: unverified > to 10.1.0.2 via fe-1/2/1.0 172.16.233.0/7 [BGP ] 00:00:12, localpref 100 AS path: 100 I, validation-state: unverified > to 10.0.0.1 via fe-1/2/0.0
Meaning
The output shows some routing instability. Eleven routes are hidden due to damping.
Displaying the Details of a Damped Route
Purpose
Display the details of damped routes.
Action
From operational mode, enter the show route damping suppressed 172.16.192.0/20 detail command.
user@R2> show route damping suppressed 172.16.192.0/20
detail
inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) 172.16.192.0/20 (1 entry, 0 announced) BGP /-101 Next hop type: Router, Next hop index: 758 Address: 0x9414484 Next-hop reference count: 9 Source: 10.0.0.1 Next hop: 10.0.0.1 via fe-1/2/0.0, selected Session Id: 0x100201 State: <Hidden Ext> Local AS: 200 Peer AS: 100 Age: 52 Validation State: unverified Task: BGP_100.10.0.0.1+55922 AS path: 100 I Localpref: 100 Router ID: 192.168.0.1 Merit (last update/now): 4278/4196 damping-parameters: aggressive Last update: 00:00:52 First update: 01:01:55 Flaps: 8 Suppressed. Reusable in: 01:14:40 Preference will be: 170
Meaning
This output indicates that the displayed route has a mask length that is equal to or greater than /17, and confirms that it has been correctly mapped to the aggressive damping profile. You can also see the route’s current (and last) figure of merit value, and when the route is expected to become active if it remains stable.
Verifying That Default Damping Parameters Are in Effect
Purpose
Locating a damped route with a /16 mask confirms that the default parameters are in effect.
Action
From operational mode, enter the show route damping suppressed detail | match 0/16 command.
user@R2> show route damping suppressed detail
| match 0/16
172.16.0.0/16 (1 entry, 0 announced)
user@R2> show route damping suppressed 172.16.0.0/16
detail
inet.0: 15 destinations, 17 routes (6 active, 0 holddown, 11 hidden) 172.16.0.0/16 (1 entry, 0 announced) BGP /-101 Next hop type: Router, Next hop index: 758 Address: 0x9414484 Next-hop reference count: 9 Source: 10.0.0.1 Next hop: 10.0.0.1 via fe-1/2/0.0, selected Session Id: 0x100201 State: <Hidden Ext> Local AS: 200 Peer AS: 100 Age: 1:58 Validation State: unverified Task: BGP_100.10.0.0.1+55922 AS path: 100 I Localpref: 100 Router ID: 192.168.0.1 Merit (last update/now): 3486/3202 Default damping parameters used Last update: 00:01:58 First update: 01:03:01 Flaps: 8 Suppressed. Reusable in: 00:31:40 Preference will be: 170
Meaning
Routes with a /16 mask are not impacted by the custom damping rules. Therefore, the default damping rules are in effect.
To repeat, the custom rules are as follows:
Damp all prefixes with a mask length equal to or greater than 17 more aggressively than routes with a mask length between 9 and 16.
Damp routes with a mask length between 0 and 8, inclusive, less than routes with a mask length greater than 8.
Do not damp the 10.128.0.0/9 prefix at all.
Filtering the Damping Information
Purpose
Use OR groupings or cascaded piping to simplify the determination of what damping profile is being used for routes with a given mask length.
Action
From operational mode, enter the show route damping suppressed command.
user@R2> show route damping suppressed detail
| match "0 announced | damp"
0.0.0.0/0 (1 entry, 0 announced) damping-parameters: timid 10.0.0.0/9 (1 entry, 0 announced) Default damping parameters used damping-parameters: aggressive damping-parameters: aggressive 10.224.0.0/11 (1 entry, 0 announced) Default damping parameters used 172.16.0.0/16 (1 entry, 0 announced) Default damping parameters used 172.16.128.0/17 (1 entry, 0 announced) damping-parameters: aggressive 172.16.192.0/20 (1 entry, 0 announced) damping-parameters: aggressive 192.168.0.1/32 (1 entry, 0 announced) damping-parameters: aggressive 192.168.0.3/32 (1 entry, 0 announced) damping-parameters: aggressive 172.16.233.0/7 (1 entry, 0 announced) damping-parameters: timid
Meaning
When you are satisfied that your EBGP routes are correctly associated with a damping profile, you can issue the clear bgp damping operational mode command to restore an active status to your damped routes, which will return your connectivity to normal operation.
Example: Configuring BGP Route Flap Damping Based on the MBGP MVPN Address Family
This example shows how to configure an multiprotocol BGP multicast VPN (also called Next-Generation MVPN) with BGP route flap damping.
Requirements
This example uses Junos OS Release 12.2. BGP route flap damping support for MBGP MVPN, specifically, and on an address family basis, in general, is introduced in Junos OS Release 12.2.
Overview
BGP route flap damping helps to diminish route instability caused by routes being repeatedly withdrawn and readvertised when a link is intermittently failing.
This example uses the default damping parameters and demonstrates an MBGP MVPN scenario with three provider edge (PE) routing devices, three customer edge (CE) routing devices, and one provider (P) routing device.
Figure 2 shows the topology used in this example.

On PE Device R4, BGP route flap damping is configured for address family inet-mvpn. A routing policy called dampPolicy uses the nlri-route-type match condition to damp only MVPN route types 3, 4, and 5. All other MVPN route types are not damped.
This example shows the full configuration on all devices in the CLI Quick Configuration section. The Configuring Device R4 section shows the step-by-step configuration for PE Device R4.
Configuration
CLI Quick Configuration
To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.
Device R1
Device R2
Device R3
Device R4
Device R5
Device R6
Device R7
Configuring Device R4
Step-by-Step Procedure
The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.
To configure Device R4:
Configure the interfaces.
content_copy zoom_out_map[edit interfaces]user@R4# set ge-1/2/0 unit 10 family inet address 10.1.1.10/30user@R4# set ge-1/2/0 unit 10 family mplsuser@R4# set ge-1/2/1 unit 17 family inet address 10.1.1.17/30user@R4# set ge-1/2/1 unit 17 family mplsuser@R4# set vt-1/2/0 unit 4 family inetuser@R4# set lo0 unit 4 family inet address 172.16.1.4/32user@R4# set lo0 unit 104 family inet address 172.16.100.4/32Configure MPLS and the signaling protocols on the interfaces.
content_copy zoom_out_map[edit protocols]user@R4# set mpls interface alluser@R4# set mpls interface ge-1/2/0.10user@R4# set rsvp interface all aggregateuser@R4# set ldp interface ge-1/2/0.10user@R4# set ldp p2mpConfigure BGP.
The BGP configuration enables BGP route flap damping for the inet-mvpn address family. The BGP configuration also imports into the routing table the routing policy called dampPolicy. This policy is applied to neighbor PE Device R2.
content_copy zoom_out_map[edit protocols bgp group ibgp]user@R4# set type internaluser@R4# set local-address 172.16.1.4user@R4# set family inet-vpn unicastuser@R4# set family inet-vpn anyuser@R4# set family inet-mvpn signaling dampinguser@R4# set neighbor 172.16.1.2 import dampPolicyuser@R4# set neighbor 172.16.1.5Configure an interior gateway protocol.
content_copy zoom_out_map[edit protocols ospf]user@R4# set traffic-engineering[edit protocols ospf area 0.0.0.0]user@R4# set interface alluser@R4# set interface lo0.4 passiveuser@R4# set interface ge-1/2/0.10Configure a damping policy that uses the nlri-route-type match condition to damp only MVPN route types 3, 4, and 5.
content_copy zoom_out_map[edit policy-options policy-statement dampPolicy term term1]user@R4# set from family inet-mvpnuser@R4# set from nlri-route-type 3user@R4# set from nlri-route-type 4user@R4# set from nlri-route-type 5user@R4# set then acceptConfigure the damping policy to disable BGP route flap damping.
The no-damp policy (damping no-damp disable) causes any damping state that is present in the routing table to be deleted. The then damping no-damp statement applies the no-damp policy as an action and has no from match conditions. Therefore, all routes that are not matched by term1 are matched by this term, with the result that all other MVPN route types are not damped.
content_copy zoom_out_map[edit policy-options policy-statement dampPolicy]user@R4# set then damping no-dampuser@R4# set then accept[edit policy-options]user@R4# set damping no-damp disableConfigure the parent_vpn_routes to accept all other BGP routes that are not from the inet-mvpn address family.
This policy is applied as an OSPF export policy in the routing instance.
content_copy zoom_out_map[edit policy-options policy-statement parent_vpn_routes]user@R4# set from protocol bgpuser@R4# set then acceptConfigure the VPN routing and forwarding (VRF) instance.
content_copy zoom_out_map[edit routing-instances vpn-1]user@R4# set instance-type vrfuser@R4# set interface vt-1/2/0.4user@R4# set interface ge-1/2/1.17user@R4# set interface lo0.104user@R4# set route-distinguisher 100:100user@R4# set vrf-target target:1:1user@R4# set protocols ospf export parent_vpn_routesuser@R4# set protocols ospf area 0.0.0.0 interface lo0.104 passiveuser@R4# set protocols ospf area 0.0.0.0 interface ge-1/2/1.17user@R4# set protocols pim rp static address 172.16.100.2user@R4# set protocols pim interface ge-1/2/1.17 mode sparseuser@R4# set protocols mvpnConfigure the router ID and the autonomous system (AS) number.
content_copy zoom_out_map[edit routing-options]user@R4# set router-id 172.16.1.4user@R4# set autonomous-system 1001If you are done configuring the device, commit the configuration.
content_copy zoom_out_mapuser@R4# commit
Results
From configuration mode, confirm your configuration by entering the show interfaces, show protocols, show policy-options, show routing-instances, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.
Verification
Confirm that the configuration is working properly.
Verifying That Route Flap Damping Is Disabled
Purpose
Verify the presence of the no-damp policy, which disables damping for MVPN route types other than 3, 4, and 5.
Action
From operational mode, enter the show policy damping command.
user@R4> show policy damping
Default damping information: Halflife: 15 minutes Reuse merit: 750 Suppress/cutoff merit: 3000 Maximum suppress time: 60 minutes Computed values: Merit ceiling: 12110 Maximum decay: 6193 Damping information for "no-damp": Damping disabled
Meaning
The output shows that the default damping parameters are in effect and that the no-damp policy is also in effect for the specified route types.
Verifying Route Flap Damping
Purpose
Check whether BGP routes have been damped.
Action
From operational mode, enter the show bgp summary command.
user@R4> show bgp summary
Groups: 1 Peers: 2 Down peers: 0 Table Tot Paths Act Paths Suppressed History Damp State Pending bgp.l3vpn.0 6 6 0 0 0 0 bgp.l3vpn.2 0 0 0 0 0 0 bgp.mvpn.0 2 2 0 0 0 0 Peer AS InPkt OutPkt OutQ Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped... 172.16.1.2 1001 3159 3155 0 0 23:43:47 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0 172.16.1.5 1001 3157 3154 0 0 23:43:40 Establ bgp.l3vpn.0: 3/3/3/0 bgp.l3vpn.2: 0/0/0/0 bgp.mvpn.0: 1/1/1/0 vpn-1.inet.0: 3/3/3/0 vpn-1.mvpn.0: 1/1/1/0
Meaning
The Damp State field shows that zero routes in the bgp.mvpn.0 routing table have been damped. Further down, the last number in the State field shows that zero routes have been damped for BGP peer 172.16.1.2.