BGP - eBGP next hop optimization
Remember that Phase 1 does not allow spoke to spoke communication. Therefore, when Spoke 1 advertises the 126.96.36.199/32 network, the Hub will receive that advertisement. The Hub, in turn, will advertise that network to Spoke 2. Spoke 2 will receive that and install it in its routing table.
Now we know that an eBGP router will always use its own IP address as the next hop address when advertising a route. Therefore, we expect that Spoke 2 will have the Hub as the next hop for the 188.8.131.52/32 network. Take a look at the routing table of Spoke 2:
Spoke2#show ip route bgp 184.108.40.206/32 is subnetted, 1 subnets B 220.127.116.11 [20/0] via 172.16.123.1, 00:38:34 18.104.22.168/32 is subnetted, 1 subnets B 22.214.171.124 [20/0] via 172.16.123.2, 00:38:34
We see a next hop of 172.16.123.2 which is Spoke 1. Why?
Because eBGP will not change the next hop to itself if the BGP next hop in the BGP table belongs to the same IP subnet as the eBGP neighbor to which the update is sent.
This is a type of next hop optimization that ensures that the shortest path is used, and no unnecessary intermediate ASes are added to the AS_PATH. Because the next hop of Spoke 1 is on the same subnet as the next hop of the Hub, the Hub chooses to advertise the next hop address as that of Spoke 1 rather than its own, when advertising Spoke 1’s routes to Spoke 2.
This optimization is called third party next hop and is described in BGP's RFC 4271.