BGP NEXT-HOP IN SHARED NETWORK


Next-Hop Attribute shows some different behavior in shared media.

When BGP is configured in shared network (example: Ethernet), the BGP peer uses the appropriate next-hop address to avoid additional hops into the path. This feature is sometimes also called Third Party Next Hop.

Consider the diagram below:



In the diagram, R1,R2, and R3 are connected through a L2 Switch in a shared network 9.9.123.0/24. Please see the naming scheme in the diagram.
We have formed the BGP peering b/w R1, R2, and R3 on their interface IPs (i.e. 9.9.123.1, 123.2, and 123.3 respectively).

Example config from R2:
———————–
router bgp 100
bgp log-neighbor-changes
network 9.9.0.2 mask 255.255.255.255
neighbor 9.9.123.1 remote-as 100
neighbor 9.9.123.3 remote-as 300
————————-
Next-Hop for prefix 9.9.0.4/32 on R1 is 9.9.14.4.
———————–
R1#sh ip bgp | i 9.9.0.4
 *>  9.9.0.4/32       9.9.14.4                 0             0 400 i
———————–
R1 advertises 9.9.0.4/32 to R2 in shared network. The next-hop for 9.9.0.4/32 on R2 will remain same 9.9.14.4.

For understanding Next-Hop Attribute and Rules, please check our related Post (NEXT-HOP ATTRIBUTE & RULES)

———————–
R2#sh ip bgp | i 9.9.0.4
 *>i 9.9.0.4/32       9.9.14.4                 0    100      0  400 i
————————
As per the Next-Hop Rule, the next-hop for a BGP prefix changes at eBGP peering.

R2 advertises the prefix 9.9.0.4/32 to R3 with expected next hop of 9.9.123.2 but this is not the case.
R2 will advertise 9.9.0.4/32 to R3 with next hop 9.9.123.1 instead of 9.9.123.2 as R1, R2, R3 are connected through the shared network and in shared network it will be weird for R3 to go to R2 and then R1 while R1 knows the arp for 9.9.123.1 and can reach R1 directly via L2 switch. This is to avoid an unnecessary extra hop on R3 while reaching 9.9.0.4/32.
——————
R3#sh ip bgp | i 9.9.0.4
 *>  9.9.0.4/32       9.9.123.1                              0 100 400 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.