cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
599
Views
5
Helpful
9
Replies

bgp next hop self query

HI gurus,

 

forgive me for asking what might be a silly question. i was testing bgp. what causes a backup route in bgp to not be showing in the bgp table/received routes but when i failover the link, this link comes in to the table/received routes. all the ibgp peers are fully meshed. in the diagram, my main concern is with the AS On the left as5500 reaching the 150 and 200 subnets. the only thing i changed was to add the next hop self commands on r2-r3.after this, i could only see 1 route to either the 150 or 200 subnet when i did show ip 200.50.2.1. but if i fail the link pointing out towards R6, the other other route through R2 becomes available. so my question is before i added the next hop self command i could see 2 routes to each subnet, one was reachable and the other wasnt. but after adding the next hop self command i could ONLY SEE 1 route that was reachable. and when i failed the one of the links, the other route was automatically installed. shouldnt both of them have been visible regardless of the next-hop-self command.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @ahmedsid432135621 ,

in BGP a router cannot advertise an advertisement that is not the best path on the local node unless some special features are used ( called add-paths).

I have explained in my previous post based on your show output why R1 after enabling next-hop self on R2 to R1,R3 and on R3 to R2,R3 sees only one path for each prefix.

 

There are two reasons:

a)  a non best path is not advertised

b) if the current best path is learned on an iBGP session do not advertise to another iBGP peer ( iBGP split horizon rule)

 

These two conditions happen in your network scenario when next-hop self is enabled because R2 and R3 can accept routes from each other and make a best path selection based on shortest AS path attribute.

Only the one among R2 and R3 that has learned the best path via eBGP will advertise it to R1.

 

I hope it is more clear now

 

Hope to help

Giuseppe

 

View solution in original post

9 REPLIES 9
Giuseppe Larosa
Hall of Fame Master

Hello @ahmedsid432135621 ,

to complete the information abour your issue

Can you post

show ip bgp 200.50.2.1

and

show ip bgp .100.50.1.1

 

from R1 without next-hop self configured on R2 , R3

and then with next-hop self configured on R2, R3

 

There is an iBGP session between R2 and R3 ? I suppose so.

 

Hope to help

Giuseppe

 

locprf.pngyes there was full mesh between the three

Hello @ahmedsid432135621 ,

we see that without next-hop self configured

on R1 there are two paths for prefix 200.50.2.1 there are two paths but both cannot be used because the BGP next-hop of each advertisement is not known in the R1 IP routing table   ( this is the real meaning of that inaccessible in round closes ).

 

so without next-hop self R1 is not able to use any path to the prefix 200.50.2.1/32 the same happens for prefix 100.1.50.1/32.

 

we can see that the AS paths attibutes are different for the two advertisements with one that is shorter 777 711 compared to 777 911 711.

Similarly it happens for the other prefix just the AS paths become 777 911 and 777 711 911 respectively.

 

Now, when you configure next-hop self on R2 to R3 and to R1 and on R3 on sessions to R2 and R1 all the BGP next-hops issues disappear and R2 and R3 can exchange routes.

For all prefixes that are installed on R3 via R2, R3 stops to advertise them to R1 and the opposite for the other set of prefixes.

R2 will not advertise to R1 a prefix that is learned via R3, the same R3 will not advertise to R1 a prefix learned via R2 for the iBGP split horizon rule.

As a result of both conditions described above with next-hop self configured receives only one advertisement for each prefix that is actually the best path to the prefix ( shorter AS path 777 711 or 777 911) and it also usable it can be installed in IP routing table.

 

So what you see is normal and correct, because before without next-hop self configured R2 could not accept prefixes from R3 and viceversa as a result of this each of them advertised its own best path to each destination and R1 saw two different paths but none of them could be used.

 

Hope to help

Giuseppe

 

MHM Cisco World
Advisor

loop prevention with next-hop

iBGP full mesh will not re-advertise any prefix the origin is one of other iBGP peer.

 so 

R2 which have eBGP prefix 150.x.x.x will send it to R3 with next-hop self.

R3 will see that the next-hop is R2 and because of loop prevention it will not re-adveriste it to R1? why because it sure due to full mesh that R2 will advertise it.

so why after removing next hop self i can see two routes for each subnet on R1. secondly the way around out of bgp split horizon is to have full mesh neighborship which i have done. full mesh was there even before and after removing next hop self

I will make lab and find final answer.

Also i read that bgp does not remove inferior routes.

Hello @ahmedsid432135621 ,

in BGP a router cannot advertise an advertisement that is not the best path on the local node unless some special features are used ( called add-paths).

I have explained in my previous post based on your show output why R1 after enabling next-hop self on R2 to R1,R3 and on R3 to R2,R3 sees only one path for each prefix.

 

There are two reasons:

a)  a non best path is not advertised

b) if the current best path is learned on an iBGP session do not advertise to another iBGP peer ( iBGP split horizon rule)

 

These two conditions happen in your network scenario when next-hop self is enabled because R2 and R3 can accept routes from each other and make a best path selection based on shortest AS path attribute.

Only the one among R2 and R3 that has learned the best path via eBGP will advertise it to R1.

 

I hope it is more clear now

 

Hope to help

Giuseppe

 

Hi friend, I do my homework and get the final result. 

to make R1 get same prefix "two path" from R2 and R3 before and after next-hop-self 

please 

dont config next-hop-self between R2 and R3 

this give you same two path in R1 with and without next-hop-self.