BGP - eBGP third party next hop

Typically, an eBGP router will advertise its routes to its peers and will install its own IP address as the next hop for that route. However, there are cases where an eBGP router will not advertise itself as the next hop, but a different eBGP router. This is called next hop optimization, and its goal is to ensure that the shortest path is used, and no unnecessary intermediate ASes are added to the AS_PATH.

Specifically, the eBGP next hop is not changed 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 called a "third party" next hop.

This behavior can be overridden by using the next-hop-self keyword in the neighbor command.