5.how To Read The BGP Table
5.how To Read The BGP Table
5.how To Read The BGP Table
com
Search...
Table of Contents
BGP
eBGP Multi-Hop
BGP Auto-summary
All pre꒟xes 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 ꒟nish with a quick peek at a
full Internet routing table.
Configuration
Here’s the topology we will use. 4 routers, each in a di侟ꅶerent 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
https://networklessons.com/bgp/howtoreadthebgptable/ 2/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
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 4.4.4.4 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 con꒟gurations are pretty straight-forward, we are using eBGP here. Note that R4 has
advertised a network (loopback interface) in BGP.
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,
https://networklessons.com/bgp/howtoreadthebgptable/ 3/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
r RIB‐failure, S Stale
Origin codes: i ‐ IGP, e ‐ EGP, ? ‐ incomplete
Network Next Hop Metric LocPrf Weight Path
*> 4.4.4.4/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 ꒟rst. This router has
network 4.4.4.4/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.
Further to the right you see metric, local preference and weight. These are the BGP attributes that
are used to select the best path.
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 놊樮apping 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
https://networklessons.com/bgp/howtoreadthebgptable/ 4/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
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
*> 4.4.4.4/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 di侟ꅶerences.
The ꒟rst 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.
R1#show ip bgp
BGP table version is 2, local router ID is 192.168.13.1
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
* 4.4.4.4/32 192.168.13.3 0 3 4 i
*> 192.168.12.2 0 2 4 i
This output is even more interesting, this router has learned about our network from R2 and R3.
Both entries are valid, they have * in front of them. BGP selected the path through R2 as the best
path, you can see the > in front of this entry.You can also see the AS paths to reach this network.
https://networklessons.com/bgp/howtoreadthebgptable/ 5/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
R1#show ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 192.168.12.2, 00:25:51
If you want you can take a closer look at one of the entries in the BGP table, this is useful when you
have a lot of networks:
R1#show ip bgp 4.4.4.4
BGP routing table entry for 4.4.4.4/32, version 2
Paths: (2 available, best #2, table Default‐IP‐Routing‐Table)
Advertised to update‐groups:
1
3 4
192.168.13.3 from 192.168.13.3 (192.168.34.3)
Origin IGP, localpref 100, valid, external
2 4
192.168.12.2 from 192.168.12.2 (192.168.24.2)
Origin IGP, localpref 100, valid, external, best
The information you see above tells us that we have two paths for this network, the second one
has been selected as the best path. Last but not least, let's take a look at R3:
R3#show ip bgp
BGP table version is 2, local router ID is 192.168.34.3
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
* 4.4.4.4/32 192.168.13.1 0 1 2 4 i
*> 192.168.34.4 0 0 4 i
Above you can see that R3 has two entries, it can use R1 or R4 to reach 4.4.4.4/32.
https://networklessons.com/bgp/howtoreadthebgptable/ 6/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
Configurations
Want to take a look for yourself? Here you will ꒟nd the con꒟guration of each device.
R1
hostname R1
!
interface fastEthernet0/0
ip address 192.168.12.1 255.255.255.0
!
interface fastEthernet0/1
ip address 192.168.13.1 255.255.255.0
!
router bgp 1
neighbor 192.168.12.2 remote‐as 2
neighbor 192.168.13.3 remote‐as 3
!
end
R2
hostname R2
!
interface fastEthernet0/0
ip address 192.168.12.2 255.255.255.0
!
interface fastEthernet0/1
ip address 192.168.24.2 255.255.255.0
!
router bgp 2
neighbor 192.168.12.1 remote‐as 1
neighbor 192.168.24.4 remote‐as 4
!
end
https://networklessons.com/bgp/howtoreadthebgptable/ 7/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
R3
hostname R3
!
interface fastEthernet0/0
ip address 192.168.13.3 255.255.255.0
!
interface fastEthernet0/1
ip address 192.168.34.3 255.255.255.0
!
router bgp 3
neighbor 192.168.13.1 remote‐as 1
neighbor 192.168.34.4 remote‐as 4
!
end
R4
hostname R4
!
interface Loopback 0
ip address 4.4.4.4 255.255.255.255
!
interface fastEthernet0/0
ip address 192.168.24.4 255.255.255.0
!
interface fastEthernet0/1
ip address 192.168.34.4 255.255.255.0
!
router bgp 4
network 4.4.4.4 mask 255.255.255.255
neighbor 192.168.24.2 remote‐as 2
neighbor 192.168.34.3 remote‐as 3
!
end
route‐views.optus.net.au>show ip bgp summary
BGP router identifier 203.202.125.6, local AS number 65535
BGP table version is 244799119, main routing table version 244799119
539211 network entries using 69019008 bytes of memory
2321994 path entries using 120743688 bytes of memory
200268/89271 BGP path/bestpath attribute entries using 24833232 bytes of memory
78014 BGP AS‐PATH entries using 3503222 bytes of memory
3793 BGP community entries using 321910 bytes of memory
18 BGP extended community entries using 448 bytes of memory
0 BGP route‐map cache entries using 0 bytes of memory
0 BGP filter‐list cache entries using 0 bytes of memory
BGP using 218421508 total bytes of memory
Dampening enabled. 557 history paths, 440 dampened paths
BGP activity 3726941/3187730 prefixes, 16191208/13869214 paths, scan interval 60
secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down
State/PfxRcd
192.65.89.161 4 7474 1318568 910036 244799121 0 0 41w2d
21006
202.139.124.130 4 7474 1306375 910020 244799121 0 0 41w2d
21024
202.160.242.71 4 7473 0 0 1 0 0 never Active
203.13.132.29 4 7474 2107424 910019 244799121 0 0 41w2d
20649
203.13.132.35 4 7474 59948648 910162 244799121 0 0 41w2d
538696
203.13.132.37 4 7474 1571073 601855 244799121 0 0 27w2d
20651
203.13.132.41 4 7474 2254818 910043 244799121 0 0 41w2d
https://networklessons.com/bgp/howtoreadthebgptable/ 9/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
20649
203.13.132.47 4 7474 46416 19778 244799121 0 0 6d07h
20649
203.13.132.49 4 7474 2260238 910030 244799121 0 0 41w2d
20649
203.13.132.51 4 7474 2296993 910146 244799121 0 0 41w2d
20649
203.13.132.53 4 7474 59909540 910088 244799121 0 0 41w2d
538696
203.202.143.3 4 7474 0 0 1 0 0 never Idle
(Admin)
203.202.143.33 4 7474 34662511 910049 244799121 0 0 41w2d
539054
203.202.143.34 4 7474 33523616 910040 244799121 0 0 41w2d
539065
This router has over 500.000 networks and knows about more than 2.000.000 paths for these
networks. It is connected to 14 neighbors (2 are down) and here's what the BGP table looks like:
route‐views.optus.net.au>show ip bgp
BGP table version is 244797821, local router ID is 203.202.125.6
Status codes: s suppressed, d damped, h history, * valid, > best, i ‐ internal,
r RIB‐failure, S Stale, m multipath, b backup‐path, x best‐external
Origin codes: i ‐ IGP, e ‐ EGP, ? ‐ incomplete
Network Next Hop Metric LocPrf Weight Path
* 1.0.0.0/24 203.13.132.47 0 7474 15169 i
* 203.13.132.37 0 7474 15169 i
* 192.65.89.161 1 0 7474 15169 i
* 203.202.143.34 0 7474 15169 i
*> 203.202.143.33 0 7474 15169 i
* 203.13.132.49 0 7474 15169 i
* 202.139.124.130 1 0 7474 15169 i
* 203.13.132.51 0 7474 15169 i
* 203.13.132.53 0 7474 15169 i
* 203.13.132.41 0 7474 15169 i
https://networklessons.com/bgp/howtoreadthebgptable/ 10/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
* 203.13.132.35 0 7474 15169 i
* 203.13.132.29 0 7474 15169 i
* 1.0.4.0/24 203.13.132.47 10 0 7474 4826 56203 i
* 203.13.132.37 10 0 7474 4826 56203 i
* 203.202.143.34 0 7474 4826 56203 i
*> 203.202.143.33 0 7474 4826 56203 i
* 203.13.132.49 10 0 7474 4826 56203 i
* 192.65.89.161 1 0 7474 4826 56203 i
* 203.13.132.51 1 0 7474 4826 56203 i
* 202.139.124.130 1 0 7474 4826 56203 i
* 203.13.132.53 1 0 7474 4826 56203 i
* 203.13.132.41 1 0 7474 4826 56203 i
* 203.13.132.35 1 0 7474 4826 56203 i
* 203.13.132.29 1 0 7474 4826 56203 i
You can keep pressing enter, this BGP table is very long. I'm only showing the ꒟rst two networks.
As you can see this router has network 1.0.0.0/24 in its BGP table and knows about 12 di侟ꅶerent
paths to get there. It decided to use 203.202.143.33 as the next hop.
It also learned about network 1.0.4.0/24 and is using 203.202.143.33 as the next hop.
This router probably knows about a couple of networks with issues, a fun way to ꒟nd these is by
searching in the BGP table and excluding everything that starts with a *. This removes all the valid
networks from the BGP table:
route‐views.optus.net.au>show ip bgp | exclude *
BGP table version is 244799956, local router ID is 203.202.125.6
r RIB‐failure, S Stale, m multipath, b backup‐path, x best‐external
Origin codes: i ‐ IGP, e ‐ EGP, ? ‐ incomplete
Network Next Hop Metric LocPrf Weight Path
d 2.93.235.0/24 203.202.143.33 0 7474 7473 3549 701
703 702 3216 8402 ?
d 203.202.143.34 0 7474 7473 3549 701
703 702 3216 8402 ?
d 203.13.132.35 1 0 7474 7473 3549 701
703 702 3216 8402 ?
https://networklessons.com/bgp/howtoreadthebgptable/ 11/17
8/8/2016 How to Read the BGP Table | NetworkLessons.com
d 203.13.132.53 1 0 7474 7473 3549 701
703 702 3216 8402 ?
h 203.13.132.53 1 0 7474 7473 1299 6453
4755 45820 45117 i
h 203.13.132.35 1 0 7474 7473 1299 6453
4755 45820 45117 i
h 31.131.7.0/24 203.202.143.33 0 7474 7473 1299 46786
5577 i
h 203.202.143.34 0 7474 7473 1299 46786
5577 i
h 203.13.132.53 1 0 7474 7473 1299 46786
5577 i
h 203.13.132.35 1 0 7474 7473 1299 46786
5577 i
I'm using the exclude command to ꒟lter every line that has a * in it. I have to use the symbol in
front of it since the * is a wildcard for regular expressions.
Above you can see two networks with issues. The ꒟rst one (2.93.235.0/24) has a d in front of it
which means it's dampened. The second network 31.131.7.0/24 has a h in front of it that indicates
that it's a history entry.
That's all I have for now about the BGP table, I hope this has been useful to understand how to
read it. It might be a fun idea to play with one of the looking glass servers yourself!
«
https://networklessons.com/bgp/howtoreadthebgptable/
» 12/17