BGP NEXT-HOP ATTRIBUTE AND RULES

BGP NEXT-HOP ATTRIBUTE AND RULES – IMPORTANT POINTS:
Consider the below diagram:

 
1.)  Next-Hop for locally originated routes is 0.0.0.0 in an AS.

Example: Next-Hop for R2’s local prefix 9.9.0.2/32 is 0.0.0.0

R2#sh ip bgp | i 9.9.0.2
BGP table version is 8, local router ID is 9.9.0.2
*> 9.9.0.2/32    0.0.0.0    0   32768     i



2.) BGP next-hop points to external BGP peer address.(default behavior) and BGP next-hop doesn’t change for all iBGP peers in that AS.

We have created full mesh peering in AS 200 (.i.e. Neighborship b/w R2-R3 and R2-R4 on loopback address).

Example: Next-Hop for 9.9.0.1/32 on R1 shows to be 9.9.12.1 (R1’s eBGP Peer IP address).
The Next-Hop will remain same on R4.

R1#sh ip bgp | i 9.9.0.1
*> 9.9.0.1/32    9.9.12.1    0   0    100  i

R4#sh ip bgp | i 9.9.0.1
*> 9.9.0.1/32    9.9.12.1    0   0    100  i



3.) If we don’t advertise 9.9.12.0/24 in BGP on R1 and R2, the prefix 9.9.0.1/32 will become unreachable on R3 and R4 as the next-hop 9.9.12.1 becomes unreachable.

Output from R4:

R4#sh ip bgp | i 9.9.0.1
* i 9.9.0.1/32    9.9.12.1     0   100   0    100 i
———-
R4#ping 9.9.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 9.9.12.1, timeout is 2 seconds:
…..
Success rate is 0 percent (0/5)


4.) Solution to this proble is “Next-Hop-Self”.


Configure neighbors R3 and R4 with “next-hop-self” command.  With this, R2 will not advertise 9.9.12.1 as next-hop for prefix 9.9.0.1/32 to R3 and R4,  but will advertise its own loopback address 9.9.0.2.

R2(config)#router bgp 100
R2(config-router)#neighbor 9.9.0.3 next-hop-self
R2(config-router)#neighbor 9.9.0.4 next-hop-self

Now the prefix 9.9.0.1/32 becomes reachable. See the difference in Next-Hops for prefix 9.9.0.1/32 given in scenario 3 and  next-hop given below from R4.


R4#sh ip bgp | i 9.9.0.1
*>i 9.9.0.1/32   9.9.0.2    0    100   0    100    i



 5.) For IBGP neighborships formed on Loopback IPs, BGP next-hop points to loopback interface of IBGP peer if next-hop-self feature is configured with the peering.



 6.) Route Reflectors doesn’t change the next-hop of the advertised prefix. They only act as the router copiers.


7.) Next-Hop only changes at eBGP peering.

Next Hop will change when prefix is advertised from AS 200 (R4) to AS500 (R5). Please see the output from R5 for prefix 9.9.0.1/32.

Example:

R5#sh ip bgp | i 9.9.0.1
*> 9.9.0.1/32    9.9.45.4    0     200  100     i


Hope you have enjoyed reading this Post. Please share your feedback if you liked this post. You can also write to us on networkurge@gmail.com.