Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

BGP NOTIFICATION Code & Subcode Reference

Direct answer

A BGP NOTIFICATION message is sent just before a peer closes the session and gives the reason as an error code and subcode — for example 2/2 bad peer AS, 4/0 hold timer expired, 6/x cease (admin shutdown, max-prefix). show bgp neighbor shows the last one.

When to use this

Use it when a BGP session drops and you need to decode the NOTIFICATION code and subcode.

First 30 seconds

1. NOTIFICATION closes the session with code/subcode: 1 header, 2 OPEN (e.g. bad peer AS, unsupported capability), 3 UPDATE, 4 hold timer expired, 5 FSM, 6 cease.

2. Cease subcodes include max prefixes, admin shutdown/reset.

3. Logged on both ends.

4. Code points to the fix.

5. Check which side sent it.

Operational verification

error detected → NOTIFICATION (code/subcode) → session closed → logged

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
Key commandshow ip bgp neighbors 192.0.2.2 | include Last reset|notification|Notif
Scope / prerequisiteUse it when a BGP session drops and you need to decode the NOTIFICATION code and subcode.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

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

3 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 Packet capture verification and known-good sequence Verify boundary
show ip bgp neighbors 192.0.2.2 | include Last reset|notification|Notif
show logging | include BGP-3-NOTIFICATION|BGP-5-ADJCHANGE
show ip bgp summary

The neighbour output gives the reason and time of the last reset and counts of notifications sent and received. The log holds the lines with code, subcode and data. The summary shows how long the session has been up or down.

Read the notification before clearing the session — a clear creates a new one (6/4) that takes its place as "last reset".

Known-good: the session is Established, and the last reset is old and has a known reason.

Step 2 Failure signatures and packet-level troubleshooting Narrow the fault
  • 2/2, peer in wrong AS. remote-as does not match the AS the neighbour presents; the data bytes show which AS it sent.
  • 2/3, bad BGP identifier. Both routers use the same router ID.
  • 4/0, hold timer expired. Keepalives were lost: link or path trouble, high CPU, or a session that depends on routes it learns through itself.
  • 6/1, maximum prefixes. The neighbour sent more prefixes than maximum-prefix allows; the session stays down until cleared or a restart timer runs out.
  • 6/2 or 6/3. The neighbour was shut down or removed on the other side.
  • 3/x. A malformed UPDATE; note the subcode and the data, and involve the sender.
  • No notification at all, the session just drops. The TCP connection was lost; look at the path.
Step 3 When the problem is really fixed Narrow the fault
  • The code, subcode and direction of the notification have been read and explain the reset.
  • The cause it points to has been corrected.
  • The session is Established and the notification counters no longer increase.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key checks
  • show ip bgp neighbors <peer> | include Last reset|Notification — last error
  • show logging | include BGP-3-NOTIFICATION — logged errors
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

A NOTIFICATION is the message a BGP router sends just before it closes a session. It contains an error code, a subcode and sometimes data — a short statement of why the session is being ended.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

It is the most direct evidence available when a BGP session goes down. Cisco IOS logs both the notifications it sends and those it receives, and remembers the last one per neighbour; reading it usually removes the need to guess.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

NOTIFICATION codes and subcodes in full

Each NOTIFICATION carries an error code, a subcode and optional data. Together they identify the exact problem. RFC 4271 defines the codes and most subcodes, RFC 5492 adds OPEN subcode 7 (Unsupported Capability), and RFC 4486 defines the Cease subcodes. Subcodes marked "deprecated" in RFC 4271 are no longer sent.

Message Header errors (code 1)

SubcodeName
1Connection Not Synchronized (marker not all ones)
2Bad Message Length
3Bad Message Type

OPEN Message errors (code 2)

SubcodeNameTypical cause
1Unsupported Version NumberNot BGP-4
2Bad Peer ASremote-as mismatch
3Bad BGP IdentifierDuplicate or invalid router ID
4Unsupported Optional ParameterA very old peer without capabilities support
6Unacceptable Hold TimeHold time of 1 or 2 s
7Unsupported Capability (RFC 5492)A required capability is missing

UPDATE Message errors (code 3)

SubcodeName
1Malformed Attribute List
2Unrecognized Well-known Attribute
3Missing Well-known Attribute
4Attribute Flags Error
5Attribute Length Error
6Invalid ORIGIN Attribute
8Invalid NEXT_HOP Attribute
9Optional Attribute Error
10Invalid Network Field
11Malformed AS_PATH

Other codes

CodeNameSubcodes
4Hold Timer ExpiredNone
5Finite State Machine ErrorUnexpected message for the current state
6Cease1–8 (RFC 4486): max-prefix, shutdown, de-configured, reset, rejected, configuration change, collision, out of resources
%BGP-3-NOTIFICATION: received from neighbor 198.51.100.9 2/2 (peer in wrong AS) 2 bytes FDEA
%BGP-3-NOTIFICATION: sent to neighbor 203.0.113.2 3/11 (malformed AS_PATH) 9 bytes ...
R1# show bgp ipv4 unicast neighbors 198.51.100.9 | include Last reset|Notification
host$ tshark -r bgp.pcap -Y "bgp.type == 3" -T fields -e bgp.notify.major_error -e bgp.notify.minor_error -e bgp.notify.data

Using the data field

In 2/2 ... FDEA, the data is the AS the neighbour actually announced, 0xFDEA = 65002. Compare it with the configured remote-as to see the mismatch immediately.

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.

Wire format, fields and state ownership

CodeMeaningCommon subcodes
1Message header error2 bad message length
2OPEN message error2 bad peer AS · 3 bad BGP identifier · 6 unacceptable hold time · 7 unsupported capability
3UPDATE message error1 malformed attribute list · 3 missing well-known attribute · 4 attribute flags error · 5 attribute length error · 11 malformed AS_PATH
4Hold timer expired—
5Finite state machine error—
6Cease1 maximum number of prefixes reached · 2 administrative shutdown · 3 peer de-configured · 4 administrative reset · 6 other configuration change

The log line names the direction and the pair of numbers:

%BGP-3-NOTIFICATION: sent to neighbor 192.0.2.2 2/2 (peer in wrong AS) 2 bytes FDE9

"Sent to" means this router detected the problem; "received from" means the neighbour did. 2/2 is code 2, subcode 2. The data bytes are what the sender objected to — here the AS number the neighbour presented, 0xFDE9 = 65001.

Three of the codes point to quite different places. Code 2 is a configuration disagreement found at session start. Code 4 means keepalives stopped arriving: a connectivity problem, not a BGP one. Code 6 is deliberate: somebody, or a configured limit, ended the session.

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 NOTIFICATION Code & Subcode Reference. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc4271.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
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 notification subcodesbgp error code
Embedded reference data

Quick lookup tables

BGP NOTIFICATION Code & Subcode Reference packet-level operational reference

Direction-aware field interpretation, suspicious signatures and the next protocol/forwarding proof boundary.

Wire boundaryKnown-good for BGP NOTIFICATION Code & Subcode ReferenceSuspicious signatureNext proof
Message identityCorrect peer/direction/type and coherent lengthsWrong sender, type, length or packet phasePacket sequence + peer state
Field semanticsError Code, Error Subcode and optional Data interpreted together with sender direction, previous BGP message, FSM state and reset timestamp match intended protocol stateoperators only see Idle/Active after the useful notification is lost, sender direction is confused, code is read without subcode, OPEN errors are blamed on IP reachability despite working TCP, UPDATE errors trigger broad policy removal, or repeated Cease/maximum-prefix behavior is treated as random transport instabilityDecode exact fields on both sides
State consequencePacket produces expected protocol/route transitionWire looks healthy but local state disagreesFSM/LSDB/BGP table → RIB/FIB
ClosureOriginal workload succeeds for the explained reasonSession/adjacency recovered only transientlyRepeat capture + regression/failover test
Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

BGP NOTIFICATION

Code/subcode reset reason.

30-second lookup

  • Open Packet Field Explorer for field-level metadata.
  • Use Packet Decoders for bit/flag values where relevant.
  • Use Paste Output / Structured Parser for CLI evidence.
  • Use Packet Filters to prove the wire boundary.

Evidence rule

A decoded field proves what is present in that packet/output at that moment. Continue through the verification chain before concluding end-to-end behavior.

Confirmation

Confirm action

Continue?