BGPPrivileged EXEC

show ip bgp [prefix]

Shows all BGP paths and attributes for a specific prefix to diagnose routing decisions.

Syntax·Privileged EXEC
show ip bgp <network-address>[/<prefix-length>]

When to Use This Command

  • Troubleshooting why a specific prefix is using one path over another.
  • Verifying BGP attributes (AS path, local pref, weight, MED) affecting path selection.
  • Confirming a prefix is in the BGP table and installed in the routing table.
  • Checking which peer originated a specific route.

Command Examples

Show all paths for a specific prefix

R1# show ip bgp 198.51.100.0/24
BGP routing table entry for 198.51.100.0/24, version 5
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  100 200
    203.0.113.1 from 203.0.113.1 (203.0.113.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0
  100 300 200
    203.0.113.5 from 203.0.113.5 (203.0.113.5)
      Origin IGP, metric 0, localpref 100, valid, external

Two paths exist. Path 1 via 203.0.113.1 has AS path '100 200' (shorter) and is marked 'best'. Path 2 via 203.0.113.5 has AS path '100 300 200' (longer). BGP prefers the shorter AS path, making path 1 best.

Prefix not in BGP table

R1# show ip bgp 10.0.0.0
% Network not in table

The prefix 10.0.0.0 is not in the BGP table — either no peer has advertised it, or it was filtered.

Understanding the Output

Key fields: '>' = best path, 'i' = iBGP source, 'e' = eBGP source. AS path is listed after the peer IP (shorter = preferred). 'localpref' (default 100) — higher wins. 'weight' (Cisco-proprietary) — higher wins, only affects local router. 'metric' = MED — lower wins. 'valid' = next hop is reachable. 'best' = selected path. The best path is installed in the IP routing table.

CCNA Exam Tips

1.

CCNA exam tip: BGP path selection order (simplified): weight > local-pref > locally originated > AS path length > origin code > MED > eBGP over iBGP > IGP metric to next hop.

2.

CCNA exam tip: 'show ip bgp' without an argument shows the entire BGP table — useful for seeing all prefixes.

3.

CCNA exam tip: A route marked 'valid' but not 'best' is in the table but not used — another path won the selection.

4.

CCNA exam tip: A route with no '>' is not installed in the routing table.

Common Mistakes

Mistake 1: Confusing 'show ip bgp' with 'show ip route' — BGP table and routing table are separate. A prefix can be in BGP but not installed if a better-admin-distance route exists.

Mistake 2: Forgetting that BGP only installs the BEST path into the routing table by default.

Mistake 3: Misreading AS path — path '100 200' means the traffic traverses AS 100 then AS 200; the origin AS is last (rightmost).

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions