How to Read the BGP Table

(sachin v) #21

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…

0 Likes

(Rene Molenaar) #22

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

0 Likes

(Aduma O) #23

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?

0 Likes

(Lazaros Agapides) #24

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

0 Likes

(Aduma O) #25

Thanks Laz, your explanation is helpful.

1 Like

(samit k) #26

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

0 Likes

(Lazaros Agapides) #27

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

0 Likes

(Rene Molenaar) #28

Hello @samit.nsn @tejashreedeshmukh021 @lagapides,

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

0 Likes

(Dominique R) #29

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

0 Likes

(Lazaros Agapides) #30

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

(Rene Molenaar) #31

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 @lagapides 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

0 Likes

(Dominique R) #32

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

0 Likes

(Fritz M) #33

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

0 Likes

(Dominique R) #34

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

0 Likes

(Rene Molenaar) #35

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

0 Likes

(Rene Molenaar) #36

Hi Fritz ,

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

Rene

0 Likes

(Muralidhar k) #37

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