Use it when a BGP session drops and you need to decode the NOTIFICATION code and subcode.
BGP NOTIFICATION Code & Subcode Reference
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.
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.
error detected → NOTIFICATION (code/subcode) → session closed → logged
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show ip bgp neighbors 192.0.2.2 | include Last reset|notification|NotifVerification & 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 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-asdoes 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-prefixallows; 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 · 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.
show ip bgp neighbors <peer> | include Last reset|Notification— last errorshow 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)
| Subcode | Name |
|---|---|
| 1 | Connection Not Synchronized (marker not all ones) |
| 2 | Bad Message Length |
| 3 | Bad Message Type |
OPEN Message errors (code 2)
| Subcode | Name | Typical cause |
|---|---|---|
| 1 | Unsupported Version Number | Not BGP-4 |
| 2 | Bad Peer AS | remote-as mismatch |
| 3 | Bad BGP Identifier | Duplicate or invalid router ID |
| 4 | Unsupported Optional Parameter | A very old peer without capabilities support |
| 6 | Unacceptable Hold Time | Hold time of 1 or 2 s |
| 7 | Unsupported Capability (RFC 5492) | A required capability is missing |
UPDATE Message errors (code 3)
| Subcode | Name |
|---|---|
| 1 | Malformed Attribute List |
| 2 | Unrecognized Well-known Attribute |
| 3 | Missing Well-known Attribute |
| 4 | Attribute Flags Error |
| 5 | Attribute Length Error |
| 6 | Invalid ORIGIN Attribute |
| 8 | Invalid NEXT_HOP Attribute |
| 9 | Optional Attribute Error |
| 10 | Invalid Network Field |
| 11 | Malformed AS_PATH |
Other codes
| Code | Name | Subcodes |
|---|---|---|
| 4 | Hold Timer Expired | None |
| 5 | Finite State Machine Error | Unexpected message for the current state |
| 6 | Cease | 1–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.
Wire format, fields and state ownership
| Code | Meaning | Common subcodes |
|---|---|---|
| 1 | Message header error | 2 bad message length |
| 2 | OPEN message error | 2 bad peer AS · 3 bad BGP identifier · 6 unacceptable hold time · 7 unsupported capability |
| 3 | UPDATE message error | 1 malformed attribute list · 3 missing well-known attribute · 4 attribute flags error · 5 attribute length error · 11 malformed AS_PATH |
| 4 | Hold timer expired | — |
| 5 | Finite state machine error | — |
| 6 | Cease | 1 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
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 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%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.
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.
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 boundary | Known-good for BGP NOTIFICATION Code & Subcode Reference | Suspicious signature | Next proof |
|---|---|---|---|
| Message identity | Correct peer/direction/type and coherent lengths | Wrong sender, type, length or packet phase | Packet sequence + peer state |
| Field semantics | Error Code, Error Subcode and optional Data interpreted together with sender direction, previous BGP message, FSM state and reset timestamp match intended protocol state | operators 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 instability | Decode exact fields on both sides |
| State consequence | Packet produces expected protocol/route transition | Wire looks healthy but local state disagrees | FSM/LSDB/BGP table → RIB/FIB |
| Closure | Original workload succeeds for the explained reason | Session/adjacency recovered only transiently | Repeat capture + regression/failover test |
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.