The configuration of the next hop affects whether the next
hop is set to the address of the router itself. BGP has certain common
rules. Whether the next hop address is reachable is the first matching
point in BGP route selection.
Procedure
Modify the next hop when advertising a route to an IBGP
peer.
By default, a device does
not change the next-hop address of a route learned from an EBGP peer
before forwarding the route to IBGP peers. The next-hop address of
a route advertised by an EBGP peer to this device is the address of
the EBGP peer. After being forwarded to IBGP peers, this route cannot
become an active route because the next hop is unreachable. The relevant
ASBR must be configured to change the next-hop address of the route
to the ASBR's own IP address before the ASBR advertises the route
to an IBGP peer. The route is active on the IBGP peer if the next
hop is reachable
If BGP load balancing is
configured, the local router changes the next hop address to its own
address when advertising routes to IBGP peer groups, regardless of
whether the peer next-hop-local command is used.
Configure the device not to modify the next hop address
when advertising a route learned from an IGP to an IBGP peer.
By default, when a peer advertises
an imported IGP route, the peer changes the next hop address to the
address of the interface connecting the local router and the remote
peer.
Configure the device not to modify the next hop address
when advertising a route to an EBGP peer.
By default, PEs of different ASs set
up EBGP peers, and modify the next hop address when the PEs advertise
routes.
In the inter-AS VPN option C networking where route
reflectors (RRs) are used, the peer next-hop-invariable command needs to be run to prevent the RRs from changing
the next-hop address of a route when the RRs advertise the route to
EBGP peers. This ensures that the remote PE iterates a route to the
BGP Label Switched Path (LSP) destined for the local PE during traffic
transmission.
Enable next-hop iteration based on the routing policy.
By default, the next-hop iteration
based on the specified routing policy is disabled.
The next-hop
iteration based on the specified routing policy can control the iterated
route according to certain conditions. The route that fails to match
the routing policy is ignored.