Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP Maximum-Prefix Protection Reference

Direct answer

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.

When to use this

Use it on every external neighbour as protection against route leaks, and when a neighbour is stuck in Idle (PfxCt).

First 30 seconds

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.

Operational verification

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
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · Cisco IOS XE
Key commandneighbor <peer> maximum-prefix <maximum> [threshold] [restart <minutes>]
Scope / prerequisiteUse it on every external neighbour as protection against route leaks, and when a neighbour is stuck in Idle (PfxCt).
Reference · 1
What next?3 suggested next steps
Catalog command links1
Evidence0
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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. restart is 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-only is 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.
Command lookup Jump straight to Cisco syntax
Key points

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.

Key checks
  • show ip bgp summary — prefixes received, or Idle (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
PartMeaning
1000The limit: at most this many prefixes are accepted from the neighbour
80Warning threshold in percent; a log message is written when it is passed (75 if omitted)
restart 15After the limit is exceeded, try to re-establish the session after 15 minutes
warning-onlyAlternative 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-only protects 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)

SubcodeNameTypical trigger
1Maximum Number of Prefixes ReachedPrefix limit crossed
2Administrative Shutdownneighbor ... shutdown
3Peer De-configuredThe neighbour was removed from the configuration
4Administrative Resetclear bgp
5Connection RejectedThe peer isn't accepted
6Other Configuration ChangeA change that requires a reset
7Connection Collision ResolutionBoth sides opened sessions; one is closed
8Out of ResourcesMemory or other limits

Configuration options (Cisco IOS XE)

OptionBehaviour
maximum-prefix 1000Close the session above 1000 prefixes; stay down until cleared
maximum-prefix 1000 80Warn at 80 %, close at 100 %
... restart 30Re-establish automatically after 30 minutes
... warning-onlyLog 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 typeGuideline
CustomerTheir registered prefixes plus a margin
Peer at an IXPThe peer's published count plus a margin (often from PeeringDB)
Full-table transitAbove the current Internet table size, with a warning threshold

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 4271

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%
Terminology layer

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.

Aliases that resolve here
bgp maximum prefixmaximum-prefixbgp prefix limitroute leak protection
Embedded quick reference

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.

Confirmation

Confirm action

Continue?