All prefixes that BGP learns are stored in the BGP table. In this lesson we’ll take a look at this table and you will learn how to read it. We’ll start with a simple topology and finish with a quick peek at a full Internet routing table.
Here’s the topology we will use. 4 routers, each in a different autonomous system:
R1#show run | section bgp router bgp 1 no synchronization bgp log-neighbor-changes neighbor 192.168.12.2 remote-as 2 neighbor 192.168.13.3 remote-as 3 no auto-summary
R2#show run | section bgp router bgp 2 no synchronization bgp log-neighbor-changes neighbor 192.168.12.1 remote-as 1 neighbor 192.168.24.4 remote-as 4 no auto-summary
R3#show run | section bgp router bgp 3 no synchronization bgp log-neighbor-changes neighbor 192.168.13.1 remote-as 1 neighbor 192.168.34.4 remote-as 4 no auto-summary
R4#show run | section bgp router bgp 4 no synchronization bgp log-neighbor-changes network 220.127.116.11 mask 255.255.255.255 neighbor 192.168.24.2 remote-as 2 neighbor 192.168.34.3 remote-as 3 no auto-summary
The BGP configurations are pretty straight-forward, we are using eBGP here. Note that R4 has advertised a network (loopback interface) in BGP.
Reading the BGP Table
Let’s take a look at the BGP tables. We’ll start with R4:
R4#show ip bgp BGP table version is 2, local router ID is 192.168.34.4 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 18.104.22.168/32 0.0.0.0 0 32768 i
Ok so what do we see here? Let’s start with the items I highlighted in red first. This router has network 22.214.171.124/32 in its BGP table and in front of the network there’s the *> symbol:
- The * means that this is a valid route and that BGP is able to use it.
- The > means that this entry has been selected as the best path.
The next hop is 0.0.0.0. The next hop of 0.0.0.0 means that this network originated on this router, that makes sense since I used the network command on R4 to advertise this network into BGP.
Path will show the AS path, there’s nothing there since this network was advertised in BGP on this router. On the other routers you’ll see something here.
The ‘i’ is the origin code and indicates that this network was advertised into BGP using the network command, the table says it refers to IGP but it doesn’t have anything to do with “interior gateway protocols”. When you redistribute something into BGP it will show up with the ? symbol. You will never see the ‘e’ symbol, this refers to EGP (Exterior Gateway Protocol) which is the predecessor of BGP.
Some of the other things you see here is the BGP table version, every time the best path changes this number will increase. You can see the BGP router ID of this router and there are some other status codes:
- supressed: BGP knows the network but won’t advertise it, this can occur when the network is part of a summary.
- damped: BGP doesn’t advertise this network because it was flapping too often (network appears, disapears, appears, etc.) so it got a penalty.
- history: BGP learned this network but doesn’t have a valid route at the moment.
- RIB-failure: BGP learned this network but didn’t install it in the routing table. This occurs when another routing protocol with a lower administrative distance also learned it.
- stale: this is used for non-stop forwarding, this entry has to be refreshed when the remote BGP neighbor has returned.
Let’s look at the BGP tables of the other routers, we’ll continue with R2:
R2#show ip bgp BGP table version is 2, local router ID is 192.168.24.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 126.96.36.199/32 192.168.24.4 0 0 4 i
The output of R2 is similar to what we have seen on R4 but there are two important differences. The first one is the next hop, R2 learned about this network from 192.168.24.4. The second thing is the AS path, it’s showing AS 4.
Let’s check R1: