Why BGP Routes Flap — Exact Troubleshooting Process

A BGP route flap occurs when a route is repeatedly advertised and withdrawn, or when the BGP neighbor session repeatedly goes up and down.

The first thing to determine is:

Is the BGP session flapping, or is only one prefix flapping?

That decision determines the troubleshooting path.


1. Check BGP Neighbor Stability

Run:

show ip bgp summary

Check the Up/Down timer.

If the timer keeps resetting:

BGP session is flapping

If the session remains stable but a route disappears and returns:

Prefix is flapping

2. If the BGP Session Is Flapping

Check the neighbor details:

show ip bgp neighbors <neighbor-ip>

Look for:

Last reset reason
Hold timer expired
BFD down
TCP reset
Peer closed session

Then verify the underlying connection.

Check the interface

show ip interface brief
show interfaces <interface>

Verify:

Interface = up/up
No CRC errors
No input errors
No link flaps


Check neighbor reachability

ping <neighbor-ip>
traceroute <neighbor-ip>

For loopback peering:

ping <neighbor-loopback> source <local-loopback>


Check BFD

If BFD is configured:

show bfd neighbors

A BFD flap can immediately reset the BGP session.


Check logs

show logging

Look for the sequence:

Interface Down
     ↓
BFD Down
     ↓
BGP Neighbor Down

If this occurs, BGP is not the root cause.


3. If Only One BGP Prefix Is Flapping

Check the prefix:

show ip bgp <prefix>

Example:

show ip bgp 10.50.50.0/24

Verify:

Next hop

Best path

AS path

Local preference

MED

Origin


Then check whether the route still exists at the originating router:

show ip route <prefix>

If the route disappears from the RIB, BGP may withdraw it.


Example:

Connected / Static / OSPF route disappears
                ↓
BGP network statement no longer matches
                ↓
BGP withdraws the prefix

4. Check BGP Next-Hop Reachability

A BGP route depends on its next hop being reachable.

Run:

show ip route <next-hop>
show ip cef <next-hop>

Example:

show ip route 10.0.12.2
show ip cef 10.0.12.2

If next-hop reachability keeps changing:

IGP / transport instability
        ↓
BGP route instability

Troubleshoot OSPF, IS-IS, static routing, or the physical path first.


5. Check Route Origination

If the route is locally advertised using:

network 10.50.50.0 mask 255.255.255.0

verify that the exact route exists:

show ip route 10.50.50.0

If the RIB route disappears, BGP withdraws the advertisement.

Also check if the route comes from redistribution:

OSPF
  ↓
Redistribution
  ↓
BGP

If the OSPF route flaps, the BGP route also flaps.


6. Check Routing Policy

If the route exists but is intermittently advertised, check policy.

show route-map
show ip prefix-list
show ip bgp neighbors <neighbor> advertised-routes

Verify:

Prefix-list permits the route
Route-map permits the route
Community policy is correct
No conditional advertisement issue

7. Check CPU and Control Plane

High CPU can cause missed BGP keepalives or BFD packets.

Run:

show processes cpu sorted
show processes memory sorted
show policy-map control-plane

Look for:

High CPU
Memory pressure
Control-plane drops

8. Exact BGP Flap Troubleshooting Workflow

Use this sequence every time:

Pasted content image

9. Most Useful Commands

show ip bgp summary
show ip bgp neighbors <neighbor>
show ip bgp <prefix>

show ip route <prefix>
show ip route <next-hop>
show ip cef <next-hop>

show ip interface brief
show interfaces

show bfd neighbors
show logging

show route-map
show ip prefix-list

show processes cpu sorted
show policy-map control-plane

10. Real Troubleshooting Example

Assume this route keeps disappearing:

10.50.50.0/24

First:

show ip bgp summary

If neighbor uptime is:

00:00:10

and keeps resetting, check:

show ip bgp neighbors 10.0.12.2

Output:

Last reset due to BFD session down

Then:

show bfd neighbors
show interfaces Gi0/0

If interface errors are increasing:

CRC errors
Input errors
Link transitions

the actual failure path is:

Physical Link Problem
       ↓
BFD Flap
       ↓
BGP Session Reset
       ↓
Routes Withdrawn
       ↓
Traffic Loss

So the correct fix is the physical link, not BGP.


Key Troubleshooting Rule

Always troubleshoot BGP in this order:

LINK
  ↓
NEIGHBOR
  ↓
NEXT HOP
  ↓
SOURCE ROUTE
  ↓
POLICY
  ↓
FORWARDING

Final Rule

If the neighbor uptime resets, troubleshoot the BGP session and its transport. If the neighbor stays stable but one route flaps, troubleshoot the route source, next hop, redistribution, or policy.