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 bgpWhen to Use This Command
- Verify that BGP routes are being received from a neighbor after establishing a BGP session.
- Check the best path selection by examining path attributes like local preference, AS path, and MED.
- Troubleshoot missing routes or suboptimal routing by comparing BGP table entries across routers.
- Confirm that route filtering or policy changes are applied correctly by inspecting the BGP table.
Command Examples
Basic BGP Table Display
show ip bgpBGP table version is 5, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/24 192.168.2.2 0 0 65001 i
*> 10.2.2.0/24 192.168.3.3 0 0 65002 65003 i
*> 172.16.0.0/16 192.168.4.4 0 0 65004 iThe output shows the BGP table. 'Status codes' indicate route validity: * means valid, > means best. 'Network' is the prefix learned. 'Next Hop' is the next-hop IP. 'Metric' is the MED value. 'LocPrf' is local preference (blank if default 100). 'Weight' is Cisco-specific weight. 'Path' shows the AS_PATH. 'Origin' code i means IGP (network command), e means EGP, ? means redistributed. The first route is best and valid, learned from AS 65001 with origin IGP. The second route passes through AS 65002 and 65003.
BGP Table with Prefixes Not Installed in Routing Table
show ip bgpBGP table version is 10, local router ID is 10.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 10.1.1.0/24 10.0.0.2 0 0 100 i
r 10.2.2.0/24 10.0.0.3 0 0 200 i
*> 10.3.3.0/24 10.0.0.4 0 0 300 iThe 'r' status code indicates RIB-failure: the route is valid but not installed in the routing table (e.g., due to administrative distance conflict or route table full). The other two routes are best and valid. This helps identify routes that are learned but not used.
Understanding the Output
The 'show ip bgp' command displays the BGP routing table. The first line shows the BGP table version (increments with changes) and the local router ID. Status codes indicate the state of each route: '*' means valid, '>' means best (selected for use), 'i' means internal (iBGP), 'r' means RIB-failure (valid but not installed in routing table), 's' suppressed, 'd' damped, etc. The 'Network' column shows the prefix. 'Next Hop' is the IP address of the next-hop router. 'Metric' is the Multi-Exit Discriminator (MED) value. 'LocPrf' is the local preference (default 100, higher is preferred). 'Weight' is a Cisco-specific attribute (higher is preferred). 'Path' shows the AS_PATH (sequence of AS numbers the route traversed). 'Origin' code indicates how the route was originated: i (IGP) from network command, e (EGP) from EGP, ? (incomplete) from redistribution. A blank LocPrf means default 100. A blank Weight means 0. Good values: best routes selected, no RIB-failures, expected AS paths. Bad values: missing routes, RIB-failures, unexpected AS paths, high MED (less preferred). Watch for routes with 'r' status or missing best path.
CCNA Exam Tips
CCNA exam tip: Remember that '>' indicates the best path selected by BGP; only best paths are installed in the routing table.
CCNA exam tip: The 'r' status (RIB-failure) is a common exam topic—know that it means the route is valid but not installed due to a higher administrative distance from another routing protocol.
CCNA exam tip: Understand that the AS_PATH length is a key BGP attribute; shorter paths are preferred. The exam may ask you to determine the best path based on AS_PATH length.
CCNA exam tip: Be able to identify the origin code: 'i' from network command, '?' from redistribution. The exam might test which origin is preferred (i over e over ?).
Common Mistakes
Mistake 1: Confusing the '>' (best) indicator with the '*' (valid) indicator; only routes with '>' are actually used.
Mistake 2: Assuming a route with 'r' status is not valid; it is valid but not installed in the routing table due to RIB-failure.
Mistake 3: Misinterpreting the AS_PATH column: forgetting that the local AS is not shown in the path (the path lists AS numbers the route has traversed).
Related Commands
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.
show ip bgp summary
Displays a summary of the BGP neighbor status and prefix counts, used to quickly verify BGP peering and routing table health.
show ip route
Displays the current IP routing table on a Cisco router, used to verify routes, check next-hop addresses, and troubleshoot connectivity issues.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions