debug ip bgp
Enables debugging of BGP events and updates to troubleshoot BGP neighbor relationships and route advertisement issues.
debug ip bgpWhen to Use This Command
- Diagnosing why a BGP session is flapping or not establishing
- Verifying BGP route advertisements and withdrawals between peers
- Troubleshooting BGP path selection or missing routes
- Monitoring BGP keepalive and update messages in real time
Command Examples
Basic BGP debugging with neighbor IP
debug ip bgp 192.168.1.1 updatesBGP: 192.168.1.1 sending UPDATE about 10.0.0.0/24 (path: 65001) - NEXT_HOP 192.168.1.1 BGP: 192.168.1.1 received UPDATE about 172.16.0.0/16 (path: 65002) - NEXT_HOP 192.168.1.2 BGP: 192.168.1.1 received UPDATE about 10.0.0.0/24 - withdrawn BGP: 192.168.1.1 sending KEEPALIVE BGP: 192.168.1.1 received KEEPALIVE
Each line shows a BGP event. 'sending UPDATE' indicates the router is advertising a route; 'received UPDATE' means it learned a route from the neighbor. The path shows AS_PATH. 'withdrawn' means the route is being removed. KEEPALIVE messages maintain the session.
Debug BGP events for all neighbors
debug ip bgp eventsBGP: 192.168.1.1 went from Active to OpenSent BGP: 192.168.1.1 went from OpenSent to OpenConfirm BGP: 192.168.1.1 went from OpenConfirm to Established BGP: 192.168.1.1 went from Established to Idle (Keepalive timer expired)
Shows state transitions of BGP neighbor sessions. 'Established' is the desired state. Transitions to 'Idle' indicate a problem, such as a keepalive timeout or configuration mismatch.
Understanding the Output
The debug ip bgp command outputs real-time BGP events. For updates, each line shows the neighbor IP, direction (sending/received), prefix, AS_PATH, and NEXT_HOP. 'withdrawn' indicates route removal. For events, state transitions are shown: Idle, Active, OpenSent, OpenConfirm, Established. A healthy session stays in Established. Frequent transitions to Idle or Active indicate issues like misconfigured passwords, AS numbers, or network reachability. Keepalive messages should appear periodically; missing keepalives may cause session drops. Use 'undebug all' to stop debugging.
CCNA Exam Tips
Remember that 'debug ip bgp' is CPU-intensive; always use specific keywords like 'updates' or 'events' to limit output.
The CCNA exam may ask which debug command to use to see BGP route advertisements; answer: 'debug ip bgp updates'.
Know that BGP states (Idle, Active, OpenSent, OpenConfirm, Established) are tested; Established is the goal.
Be aware that 'debug ip bgp' requires privileged EXEC mode and can impact production routers.
Common Mistakes
Running 'debug ip bgp' without specifying a neighbor or filter, flooding the console with excessive output.
Forgetting to disable debugging with 'undebug all' or 'no debug ip bgp', causing performance degradation.
Misinterpreting 'withdrawn' as an error; it is normal when routes are removed due to policy or network changes.
Related Commands
show ip bgp
Displays the BGP routing table, showing learned BGP routes and their attributes, used for troubleshooting BGP path selection and verifying route advertisement.
show ip bgp neighbors
Displays detailed information about BGP neighbor sessions, including state, timers, and advertised/received prefixes, used to verify BGP peering and troubleshoot neighbor relationships.
undebug all
Disables all active debug operations on the router, used to stop debugging output and reduce CPU load.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions