Read me the show ip bgp table. What do the codes and columns mean?
Show the answer
Say this first
On the left, status codes: * valid, > best, i learned over iBGP, plus r RIB-failure, s suppressed,
d dampened, h history and m multipath. Then the prefix, the next hop (0.0.0.0 means this router
originated it), Metric (the MED), LocPrf, Weight (32768 for my own routes, 0 for learned ones), the AS path,
and the origin code at the end: i IGP, e EGP, ? incomplete, usually redistributed.
Go deeper
R1 is in AS 64500, with eBGP to ISP1 (AS 64496) and ISP2 (AS 64497) and iBGP to R2 and R3.
R1# show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 192.0.2.1 0 200 0 64496 i
* 198.51.100.1 0 0 64497 i
*>i 10.20.0.0/16 10.255.0.2 20 100 0 ?
*> 203.0.113.0 0.0.0.0 0 32768 i
r>i 172.16.5.0/24 10.255.0.3 0 100 0 i- 0.0.0.0: two paths. A blank Network column means "same prefix as the line above". The ISP1 path is best because an inbound route map set LOCAL_PREF 200. LocPrf is blank on the ISP2 line because eBGP routes show no value unless policy set one; they are treated as 100.
- 10.20.0.0/16: from R2 over iBGP, origin
?because R2 redistributed it from OSPF. The OSPF metric 20 became the MED. - 203.0.113.0: our own prefix from a
networkstatement. Next hop 0.0.0.0, weight 32768. - 172.16.5.0/24:
rRIB-failure. BGP picked a best path, but the routing table already holds a route with a better administrative distance, for example OSPF (110) beating iBGP (200).
IOS prints classful-boundary prefixes without a length: 203.0.113.0 is the /24, while 10.20.0.0/16 needs
the length because it is not a class A boundary.
Next step
show ip bgp 0.0.0.0 lists every path with all its attributes and marks which one is best.
They will ask next
Why does Cisco give locally originated routes a weight of 32768?
So the router always prefers its own route over the same prefix learned from a peer. Weight is the first step of best path selection.
Which origin code does a network statement give, and which does redistribution give?
networkandaggregate-addressgivei. Redistribution gives?. Originecame from the old EGP protocol and you will not see it in practice.
Traps
- Reading next hop 0.0.0.0 as a default route. In this table it means the route was originated here.
- Assuming the first path listed is the best one. Look for the
>.