Packet Path/

BGP Neighbor Flapping Explained: Why a BGP Session Keeps Going Up and Down

A BGP neighbor that keeps going down and coming back up is flapping, and %BGP-5-ADJCHANGE is the log line that records every change. The cause is almost never BGP itself: hold timers expire when keepalives are lost to congestion, large updates vanish into an MTU black hole, firewalls reset TCP 179, the peer restarts the session on purpose, or routes stay missing afterwards because dampening suppressed the prefixes — not the session. This guide shows how to read the log pattern, separate the causes, and fix the path in a safe order.

Routing · Intermediate · 10 min · November 27, 2026

Editorial illustration on a dark teal background: two routers linked by a glowing cyan connection that turns dashed and breaks with a small spark in the middle, above an amber timeline trace that repeatedly spikes and drops.

The short answer

What is BGP neighbor flapping? A BGP session — the connection between two routers that exchange routes — keeps going down and back up instead of staying established. Each change is logged as %BGP-5-ADJCHANGE, with the neighbor address and the word Up or Down. One drop can be a real failure or a deliberate restart. The same neighbor dropping repeatedly is flapping, and the cause is almost never BGP itself: something underneath — a lossy link, a broken TCP connection, a wrong packet size, or a person resetting the session — keeps breaking it. Read the log sequence and the reset reason, not any single drop.

Picture two offices that must stay on one long phone call to keep swapping delivery lists. The call keeps cutting out mid-sentence, so they hang up, redial, swap half a list, and lose it again. Nothing is wrong with what they are saying — the line keeps failing underneath the conversation.

In plain EnglishBGP session (adjacency): the ongoing connection between two BGP neighbors; while it is up, they exchange routes. Hold timer: how long a router waits in silence before declaring the neighbor gone. Keepalive: a small periodic message whose only job is to say "still here" and reset the hold timer. TCP port 179: BGP rides on a TCP connection to port 179 — break or block it, and the session breaks too. MTU black hole: the largest packet a path accepts (its MTU) is wrong somewhere, so big packets vanish silently while small ones pass. Dampening: route flap dampening — a penalty system that suppresses individual routes (prefixes) that keep changing. Cease notification: a formal BGP message sent when a router deliberately closes a session, for example after an admin reset.

How to read %BGP-5-ADJCHANGE in plain English

%BGP-5-ADJCHANGE: neighbor 203.0.113.1 Down BGP Notification received
%BGP-5-ADJCHANGE: neighbor 203.0.113.1 Up

The line tells you what changed and when, but not why. The why lives around the line: the timestamps (regular and random intervals point at different causes), show bgp neighbors on both ends (the last reset reason, and how long the session has survived), the interface logs and error counters at the same times, and the TCP and MTU checks below. For the message itself, see the Error Decoder entry for %BGP-5-ADJCHANGE.

One neighbor, four log lines: the pattern is the evidence09:02 Up09:05 Down09:06 Up09:11 Downup for 3 minup for 5 minADJCHANGE UpADJCHANGE DownADJCHANGE UpADJCHANGE DownShort, uneven up-times: the session connects fine, then something kills it.Compare these timestamps with interface logs before changing any BGP setting.

A flap timeline. The session establishes cleanly every time, but survives only minutes — pointing underneath BGP: the link, TCP, or packet size.

The causes, in working order

1. Hold-timer expiry on a congested or dying path. The classic cause. On Cisco IOS the default hold time is 180 seconds, with a keepalive every 60 seconds, unless the neighbors negotiate lower values at session setup. If no keepalive or update arrives in time, the neighbor is declared dead — and congestion, a failing optic or a saturated CPU can all swallow keepalives. Evidence: regular-interval drops, a reset reason of hold time expired, a session surviving roughly the same time each cycle.

2. MTU black-holing. The session establishes happily — opening messages are small — then dies once real routes flow in large updates that a tunnel or link on the path silently drops, because it accepts fewer bytes than the ends assume and the "too big" replies that would reveal it are filtered. Evidence: small pings pass, large do-not-fragment pings fail at one size, drops line up with route exchange, not the clock.

3. TCP 179 resets, or blocked return traffic. BGP is only as healthy as its TCP connection. A firewall or ACL that allows setup but drops or resets TCP 179 mid-session — or blocks the return path — kills a good session. Evidence: the reset reason points at TCP, and drops track a middlebox, not interface errors.

4. The other end really did restart it. A peer reload, a configuration change, or an engineer running clear ip bgp produces a genuine teardown — often announced with a Cease notification, BGP's formal "closing this on purpose" message. Evidence: the peer's logs and uptime agree, and its team can say what they did — ask before troubleshooting your own side.

5. The physical interface underneath is flapping. If the link itself bounces, every session on it follows. Evidence: interface up/down lines at exactly the ADJCHANGE timestamps, plus rising CRC or input errors.

6. Dampening — the one that is usually innocent. Route flap dampening penalises flapping prefixes: a route that keeps appearing and disappearing earns penalty points and is suppressed for a while. It does not dampen the neighbor session itself — nothing in dampening tears a session down. But it explains a confusing aftermath: after the session stays Up, some routes stay missing a while, suppressed while it bounced — the prefixes are still serving their penalty.

Flapping is not the same failure as a neighbor that never comes up. A session stuck before Established — cycling through Idle and Active — is a connection problem from packet one, covered in BGP neighbor states explained and, as a worked fault, in BGP neighbor stuck in Active. For what it carries once stable, see BGP explained.

Separate the causes: what else happened at the drop time?The session dropped againcheck the same timestamp elsewhereRegular intervals,no interface logsHold-timer expiry:keepalives lost tocongestion or a dying linkInterface down/up logsat the same timesPhysical flap underneath:check CRC errors, opticsand the cable path firstConnects fine, dropswhen routes flowMTU black hole:small packets pass,large updates vanishNone of these? Check TCP 179 resets and ask the peer about resets on their side.

A three-way split that resolves most flaps: match drop timestamps against the clock pattern, the interface log, and packet size.

Checks in order

  1. Read the log timestamps and compute the interval pattern. Regular intervals suggest timer expiry under loss; busy-hour drops suggest congestion; drops with matching interface messages suggest the physical path.
  2. Read show bgp neighbors detail on both ends — last reset reason and current session uptime. Hold time expired, a TCP reset, and a notification received are three different investigations.
  3. Check the underlying interface at the same times — state changes, CRC and input errors. If it flapped, stop: BGP is the victim, not the cause.
  4. Test TCP 179 reachability both ways. Confirm the connection opens from each side and nothing on the path drops or resets port 179 in either direction.
  5. Test MTU with do-not-fragment ping sweeps. Raise the size until pings fail; a hard ceiling below the expected size locates the black hole. The site's troubleshooting case works this fault's close cousin: a neighbor stuck in Active.
  6. Check whether many neighbors flapped at once. If every session bounced together, the fault is local — the router, its CPU, or shared transport — not one peer. If only one bounced, look at that path and peer.
  7. Ask the peer what their logs say before changing configuration. A Cease notification, a reload, or a maintenance window on their side ends the investigation in one message — reconfiguring your side to chase their restart only adds a second fault.

Fixes and prevention, in a production-safe order

Fix the underlying link and transport first — the failing optic, the congested segment, the loss. Every other fix is decoration while packets still drop. Do not just raise the hold timer to silence the alarms: a longer timer does not repair loss, it only delays detection of real failures — a noisy warning traded for a slower failover.

Correct MTU and MSS where tunnels are involved: set the tunnel MTU honestly and clamp the TCP maximum segment size to match, so updates are never built bigger than the path can carry. Remove TCP 179 drops: audit ACLs and firewall policy on the whole path, both directions, return traffic included. Handle intentional resets gracefully: schedule clear ip bgp and peer changes under change control, warn the other side, and expect routes to stay suppressed a while afterwards where dampening is enabled. Then verify: session uptime climbs past every previous failure interval, ADJCHANGE lines stop, missing routes return as penalties expire.

Try it yourselfWhile a session is stable, inspect a real prefix and its AS path with the free BGP Toolkit. Before the next flap, run both ends' neighbor configuration through the free Network Config Verifier to compare timers, authentication and MTU-adjacent settings.

Fact-check sources: hold timer and keepalive behaviour, the 180-second hold and 60-second keepalive Cisco IOS defaults unless negotiated lower, and the Cease notification — RFC 4271 and Cisco BGP documentation. Dampening as a per-prefix penalty — RFC 2439.

Related guides

Key takeaways

Keep reading