How to Read the BGP Table

Hi Rene,

Firstly I appreciate your knowledge and skills to explain topics in easy way.

My question is we are observing two paths to reach network 4.4.4.4 on R3 router and just one path from R2. Both of them are just one hop away so why this difference is seen in two outputs. Please reply to this question…

Hi Sachin,

The answer is in the output of R1:

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

It has installed R2 as the best path to get to 4.4.4.4, so it doesn’t advertise the route through 192.168.13.3 to R2.

Rene

Hi Rene,

Thank you for the lesson. I set up your topology and ran the configuration but the routers did not learn BGP route until i added the command “Network x.x.x.x Mask x.x.x.x” for each router for connecting network. Is it suppose to be so?

Hello Aduma

Yes, that is the case. Notice in Rene’s initial configuration, the routers become BGP neighbors but there is only a single route being advertised between the four routers, that is the 4.4.4.4 network on R4. If you go into all the BGP tables of all the routers, only that route will be indicated.

So unless you explicitly configure the network command, no routes will be advertised.

I hope this has been helpful!

Laz

Thanks Laz, your explanation is helpful.

1 Like

Hi Rene, i have also the same question, could you please explain

Hello Samit and Tejashri

This is a very good question. That’s why I labbed this one up and in the routers that I set up, it seems that R1, R2 and R3 all have two routes to the destination. I don’t see why R2 should only have one route. I’ll ask Rene to take a look at this one and if needed, the lesson can be modified appropriately.

Thanks for bringing it up!

Laz

Hello @samit.nsn @tejashreedeshmukh021 @lagapidis,

It makes sense why R2 only has one route. Let’s take a look:

R1#show ip bgp           

     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

R1 has two paths, one through R2 and another one through R3. The one through R2 is installed so that’s why R1 never advertises the path through R3 to R2:

R1#show ip bgp neighbors 192.168.12.2 advertised-routes 

     Network          Next Hop            Metric LocPrf Weight Path
 *>   4.4.4.4/32       192.168.12.2                           0 2 4 i

Total number of prefixes 1 

You can test this by changing the weight so R1 prefers R3:

R1(config)#route-map PREFER_R3 permit 10
R1(config-route-map)#set weight 1000

R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.13.3 route-map PREFER_R3 in

R1 now uses R3:

R1#show ip bgp 

     Network          Next Hop            Metric LocPrf Weight Path
 *>   4.4.4.4/32       192.168.13.3                        1000 3 4 i
 *                     192.168.12.2                           0 2 4 i

The path through R3 is installed and R1 advertises it to R2:

R1#show ip bgp neighbors 192.168.12.2 advertised-routes 

     Network          Next Hop            Metric LocPrf Weight Path
 *>   4.4.4.4/32       192.168.13.3                        1000 3 4 i

R2 has it now:

R2#show ip bgp

     Network          Next Hop            Metric LocPrf Weight Path
 *    4.4.4.4/32       192.168.12.1                           0 1 3 4 i
 *>                    192.168.24.4             0             0 4 i

I hope this helps!

Rene

1 Like

hi René and staff,
this is a basic question about this lesson (sorry)
Using looking glass servers, I don’t understand how you could filter the routes with | exclude *
Image1
What symbol did you use ?
Thanks

1 Like

Hello Dominique

You are correct that this should not work. This is because the ‘*’ character is a special character used in regular expressions and cannot be used as a single character pattern to be searched for and found. In order to make it work, you must precede each character with a backslash ‘’. The command would work if you entered

show ip bgp | exclude \*

More details about this syntax can be found on the second page of the following Cisco documentation:

I will let Rene know to revise the lesson appropriately.

Thanks for bringing this to our attention!

Laz

1 Like

Hi Dominique,

I did the exclude example in my lesson on a Cisco router where the exclude parameter looks for a string. The looking glass server you used requires a regular expression and in that case, you need to ignore the * with a slash like @lagapidis explained.

On a Cisco router, you can also use regex but you have to specify it like this:

route-server.ams2>show ip bgp regexp \*

Hope this helps!

Rene

Thanks a lot Rene and Laz to spend time in replying me,

I am playing with looking glass servers and show ip bgp regexp \* don’t work as show ip bgp | exclude \*


exclude \* is filtering valid routes from output (so you will get only lines with d and h from the output)
but regexp \* seems not to apply in this case (filtering valid routes) because it only filters on the AS path (and not on valid routes)
So, and again sorry about that, but i dont understand your reply
And when playing with looking glass servers, i wonder how to filter on other attributes like metric, weight, …i don’t know if it is a legitimate question, and i did not find the answser yet
Regards

Hi Rene,

I tried to lab your given example, I would like to confirm with you why 4.4.4.4 is not reachable in R1? Even I tried to advertised 192.168.24.0/24 in R2 and 192.168.34.0/24 in R3.

Best Regard,
Fritz Macahilig

Network Diagram
Capture

Hi,
i am not Rene neither his staff, but i think
to understand your question, you will have to put the configs of the routers in your lab (not only the network diagram)
Then I’ll try to answer
Regards

Hello Dominique,

Are you still having issues with this? Like you mentioned, regex for BGP only works for AS numbers:

route-views.optus.net.au>show ip bgp regexp ?
  LINE  A regular-expression to match BGP AS paths. Use "ctrl-v ?" to enter "?"

If you want to filter anything else then you should use the “include” command instead. You can also use regex for the include command. For example:

route-views.optus.net.au>show ip bgp | include _10_
*  1.0.0.0/24       203.13.132.7            10             0 7474 4826 13335 i
*                   202.139.124.130         10             0 7474 4826 38803 56203 i
*                   202.139.124.130         10             0 7474 4826 38803 56203 i

The example above applies regex to the entire output of the show command. You can get pretty creative with that.

The things you can do a on a looking glass server are limited. On your own routers, you can also combine show ip bgp with a route-map if you want to see specific things:

show ip bgp route-map ?
  WORD  A route-map to match on

Does this help?

Rene

Hi Fritz ,

Did you use my exact configs? If not, it’s best to paste the output of your BGP tables here.

Rene

Basically, R4 doesn’t have the R1’s interface subnets in its routing table. In order to make it work, you will have to advertise the network interfaces of R1 into BGP.

R1(config)#router bgp 1
R1(config-router)#network 192.168.12.0 mask 255.255.255.0
R1(config-router)#network 192.168.13.0 mask 255.255.255.0

Now ping from R1, it should work.

1 Like

Hi,

On NXOS9kv ive configured eBGP to multipath up to 2 spines.

leaf1# sh run bgp
!Command: show running-config bgp
!Time: Thu Jun 27 09:53:11 2019

version 7.0(3)I7(1)
feature bgp

router bgp 64521
  router-id 3.3.3.3
  address-family ipv4 unicast
    network 172.16.1.0/24
    maximum-paths 2
  neighbor 1.1.1.1
    remote-as 64520
    description eBGP peer spine1
    update-source loopback0
    ebgp-multihop 2
    address-family ipv4 unicast
      send-community
      next-hop-self
  neighbor 2.2.2.2
    remote-as 64520
    description eBGP peer spine2
    update-source loopback0
    ebgp-multihop 2
    address-family ipv4 unicast
      send-community
      next-hop-self

However can you confirm why the bgp table shows a blank entry by the network like so,

Thanks,

Hello Rick

If I understand your question correctly, you are asking why the value under the Network column is empty, where you have placed the blue box correct? If that is the case, then when the BGP table has a blank in the network section, what this means is that the network is the same as the one above it. In this case, it is showing that to get to network 172.16.2.0/24 you have either a next hope of 1.1.1.1 or 2.2.2.2. If there was a third choice to reach that network, it would appear below in the next line with an empty Network entry, showing another Next Hop value.

Take a look at this lesson that details this information more fully.

I hope this has been helpful!

Laz

Hi,

If in the BGP Table the best path failed, how it select the second best path ?