Use it on every external neighbour as protection against route leaks, and when a neighbour is stuck in Idle (PfxCt).
BGP Maximum-Prefix Protection Reference
neighbor <ip> maximum-prefix <n> limits how many routes a BGP router accepts from one neighbour. When the limit is exceeded, the session is closed — or, with warning-only, just logged.
1. show ip bgp summary — Idle (PfxCt)?
2. show logging | include MAXPFX — how many did the neighbour send?
3. Leak or legitimate growth? Ask the neighbour.
4. Fix the cause or raise the limit.
5. clear ip bgp <ip> to bring the session back.
limit configured with headroom → received count below the warning threshold → session Established; count above the limit → NOTIFICATION 6/1, Idle (PfxCt) → cause removed or limit raised → session cleared
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
neighbor <peer> maximum-prefix <maximum> [threshold] [restart <minutes>]Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational verification Verify boundary
show ip bgp summary
show ip bgp neighbors 192.0.2.2 | include Maximum|prefixes|Threshold
show ip bgp neighbors 192.0.2.2 | include Last reset
show logging | include MAXPFX
The summary shows the current number of prefixes received, or Idle (PfxCt) for a neighbour held down by the limit. The neighbour output shows the configured maximum, the warning threshold and whether a restart interval applies, along with the current count. The last reset reason and the log confirm that the limit was the cause.
Known-good: the current count is comfortably below the limit, and no warning messages are being logged.
Step 2 Failure isolation workflow Narrow the fault
- A neighbour shows Idle (PfxCt). It exceeded the limit. Find out why it sent more, correct that or raise the limit, then
clear ip bgp <neighbor>. - The session comes up and drops again at fixed intervals.
restartis configured and the neighbour still sends too many routes. - A warning is logged at regular intervals. The count is above the threshold; the limit is too tight for normal growth, or something is leaking.
- The limit was exceeded by a legitimate change. The neighbour added networks; agree on a new number.
- The limit never triggers although far too many routes arrive.
warning-onlyis set, or the limit is configured under a different address family. - Clearing the session brings it down again immediately. The cause has not been removed.
After the limit is exceeded the session stays down until clear ip bgp <ip>, unless a restart interval is set — and it drops again if the neighbour still sends too many. Set the limit with headroom over the normal count. It complements a prefix filter and does not replace one.
show ip bgp summary— prefixes received, orIdle (PfxCt).show ip bgp neighbors <ip> | include Maximum|prefixes|Threshold— limit, warning threshold, restart.show ip bgp neighbors <ip> | include Last reset— the reason.show logging | include MAXPFX— warnings and the exceed event.
ReferenceWhat it is1 section · depth on demand
Mechanics & mental model
Maximum-prefix is a limit on how many routes a BGP router will accept from one neighbour. When the neighbour sends more, the router logs a warning or closes the session, depending on configuration.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
A neighbour that suddenly sends far more routes than agreed — through a leaked full Internet table or a filtering mistake — can exhaust memory or misdirect traffic for a whole network. The limit turns that into a contained event: one session down. In operation it is also the reason for a particular kind of outage, a session that goes down and stays down until someone clears it.
ReferenceHow it works1 section · depth on demand
How it works
router bgp 65001
neighbor 192.0.2.2 maximum-prefix 1000 80 restart 15
| Part | Meaning |
|---|---|
1000 | The limit: at most this many prefixes are accepted from the neighbour |
80 | Warning threshold in percent; a log message is written when it is passed (75 if omitted) |
restart 15 | After the limit is exceeded, try to re-establish the session after 15 minutes |
warning-only | Alternative to closing the session: only log |
When the limit is exceeded and warning-only is not set:
1. The router sends a NOTIFICATION — code 6, subcode 1 — and closes the session.
2. All routes from the neighbour are removed.
3. The neighbour is held in Idle, shown as Idle (PfxCt) in the summary.
4. Without restart, it stays there until an administrator runs clear ip bgp <neighbor>. With restart, the router tries again after the interval — and goes down again if the neighbour still sends too many.
The log shows one message when the warning threshold is passed and another when the limit is exceeded, each with the neighbour and the count.
Details.
- The limit is set per neighbour and per address family.
- On Cisco IOS it normally counts the prefixes accepted after inbound filtering, so a prefix list that drops unwanted routes also keeps the count down. Verify this on the platform in use before relying on it.
warning-onlyprotects nothing; it is for observation.
Choosing a value. Take the number of prefixes the neighbour normally sends and add reasonable headroom — enough for growth, not enough to accommodate a leak. A customer announcing 20 prefixes might get a limit of 50; a limit set at 20 would take the session down the day the customer adds one network. The limit complements, and does not replace, a prefix filter that states exactly what the neighbour may announce.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Maximum-prefix protection
A neighbour that suddenly sends far more routes than expected, through a leak or a misconfiguration, can exhaust memory or attract traffic it can't carry. Maximum-prefix limits the number of prefixes accepted from one peer. When the limit is crossed, the router closes the session with a Cease NOTIFICATION. RFC 4486 gives that event subcode 1, Maximum Number of Prefixes Reached. The data field may carry the AFI, the SAFI and the configured upper bound, so the peer can see which limit was hit.
Cease subcodes (RFC 4486)
| Subcode | Name | Typical trigger |
|---|---|---|
| 1 | Maximum Number of Prefixes Reached | Prefix limit crossed |
| 2 | Administrative Shutdown | neighbor ... shutdown |
| 3 | Peer De-configured | The neighbour was removed from the configuration |
| 4 | Administrative Reset | clear bgp |
| 5 | Connection Rejected | The peer isn't accepted |
| 6 | Other Configuration Change | A change that requires a reset |
| 7 | Connection Collision Resolution | Both sides opened sessions; one is closed |
| 8 | Out of Resources | Memory or other limits |
Configuration options (Cisco IOS XE)
| Option | Behaviour |
|---|---|
maximum-prefix 1000 | Close the session above 1000 prefixes; stay down until cleared |
maximum-prefix 1000 80 | Warn at 80 %, close at 100 % |
... restart 30 | Re-establish automatically after 30 minutes |
... warning-only | Log only; keep the session up |
R1(config-router-af)# neighbor 203.0.113.2 maximum-prefix 1200 85 restart 30
%BGP-4-MAXPFX: Number of prefixes received from 203.0.113.2 (afi 0) reaches 1021, max 1200
%BGP-3-MAXPFXEXCEED: Number of prefixes received from 203.0.113.2 (afi 0): 1201 exceeds limit 1200
%BGP-3-NOTIFICATION: sent to neighbor 203.0.113.2 6/1 (Maximum Number of Prefixes Reached) 7 bytes 0001 0100 0004 B0
R1# show bgp ipv4 unicast neighbors 203.0.113.2 | include Maximum prefixes|Threshold|reset
R1# clear bgp ipv4 unicast 203.0.113.2
The 7 data bytes in the NOTIFICATION are AFI 1 (IPv4), SAFI 1 (unicast) and the limit 0x000004B0, which is 1200. That is the RFC 4486 format.
Choosing limits
| Peer type | Guideline |
|---|---|
| Customer | Their registered prefixes plus a margin |
| Peer at an IXP | The peer's published count plus a margin (often from PeeringDB) |
| Full-table transit | Above the current Internet table size, with a warning threshold |
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → BGP Maximum-Prefix Protection Reference. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Operational notes
Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.
BGP Maximum Prefix — Fast Check
Route-leak guardrail checklist
1. Current received prefixes.
2. Configured maximum/threshold.
3. Reset/log reason.
4. Identify unexpected routes.
5. Verify import policy.
6. Change limit only with design evidence.