What is the description of the ebgp-max-hop attribute of specified BGP neighbors?
Take the following networking as an example:
The IGP routes between the NE80E, NE40E-1, and NE40E-2 are reachable.
The NE80E and NE40E-1 establish the EBGP neighbor relationship.
The NE80E and NE40E-2 establish the EBGP neighbor relationship.
Take the EBGP neighbor relationship between NE40E-1 and the NE80E as an example.
1. If the ebgp-max-hop attribute is not configured, EBGP checks the outbound interface (because the directly connected BGP neighbors need to fast detect interfaces) when establishing neighbor relationships. If the loopback interface of a peer is used to establish BGP neighbor relationships, the check fails. The check can pass only when the BGP neighbors are directly connected, because EBGP checks on the local device whether there is an interface address on the same network segment of the local device. This is different from route searching. In this case, when the ebgp-max-hop attribute is not configured, the EBGP neighbor relationship can be established only between directly connected devices rather than through loopback interfaces. The EBGP neighbor relationship cannot be established due to a failure to find an outbound interface rather than an improper number of hops.
2. When the ebgp-max-hop attribute is configured with the hop number not being 1, the system considers that the devices are indirectly connected. Thus, no fast detection is required on the interfaces and there is no more need to check the outbound interface. In this case, the TTL is checked based on the configured number of hops.
3. There is only one hop from NE40E-1 to the loopback address of the NE80E. This cannot work because when there is only one hop, it means that the two devices are directly connected. In this case, the outbound interface must be checked. As a result, you must configure hop number as 2. If the path is NE40E-1-->NE40E-2-->NE80E, there are two hops. The TTL defines the number of hops as the number of devices, irrespective of whether the receive end is a loopback interface or not. When ebgp-max-hop is set to 2, NE40E-1 and the NE80E establish the EBGP neighbor relationship through loopback interfaces. In this case, the EBGP neighbor relationship can be established through both the path NE40E-1-->NE80E and the path NE40E-1-->NE40E-2-->NE80E.