The peer next-hop-local command configures a BGP device to set its IP address as the next hop of routes when the BGP device advertises routes to an IBGP peer.
The undo peer next-hop-local command restores the default setting.
By default:
Usage Scenario
The peer next-hop-local command is usually run on an ASBR. By default, when an ASBR forwards a route learned from an EBGP peer to its IBGP peers, the ASBR does not change the Next_Hop of the route. Therefore, the Next_Hop address of the route remains the EBGP peer IP address. After being forwarded to the IBGP peers, the route cannot become active because of the unreachable Next_Hop. The peer next-hop-local command needs to be run to configure the ASBR to modify the Next_Hop of the route to the local IP address before advertising the route to IBGP peers. After being forwarded to the IBGP peers, the route can be active because the Next_Hop is reachable (an IGP is configured in the AS).
Configuration Impact
If the peer next-hop-local command is run more than once, the latest configuration overrides the previous one.
After the peer next-hop-local command is configured on a device, the device sets its IP address as the next hop of routes when the BGP device advertises the routes to its IBGP peer.Precautions
The peer next-hop-local command is applicable to IBGP peers.
If both the peer next-hop-local and peer next-hop-invariable commands are run, the latest configuration overrides the previous one. If the command is run on a route reflector, the command takes effect for BGP labeled routes, VPNv4 routes, and VPNv6 routes. On a public network, except for BGP labeled routes, VPNv4 routes, and VPNv6 routes, this command does not take effect on a route reflector (RR) or a peer in a BGP confederation.