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 or peer group.The undo peer next-hop-local command restores the default setting.
By default:
Parameter | Description | Value |
---|---|---|
ipv4-address |
Specifies the IPv4 address of a peer. |
The address is in dotted decimal notation. |
reflect-effective |
Configures the device to set its IP address as the next hop of routes when the device advertises the routes to an IBGP peer or peer group in RR scenarios. |
- |
ipv6-address |
Specifies the address of the IPv6 peer to be displayed. |
The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X. |
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).
The peer next-hop-local command is valid only for the labeled routes on a BGP route reflector. If the keyword reflect-effective is configured, the command is valid for MVPN address family routes, IPv6 MVPN address family routes, and MDT address family routes. To configure a BGP device to set its IP address as the next hop of other types of routes, you can apply an export policy.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 or peer group.
Precautions
The peer next-hop-local command is applicable to IBGP peers.
When the BGP device advertises routes to an IBGP peer group, the peer next-hop-local command and the peer next-hop-invariable command are mutually exclusive. If the peer next-hop-local command is run on a route reflector, the command takes effect for BGP labeled routes, VPNv4 routes, and VPNv6 routes. If the peer next-hop-local command is run on a route reflector or a peer in a BGP confederation, the command takes effect only for BGP labeled routes, VPNv4 routes, and VPNv6 routes over the public network and does not take effect for the other types of routes.<HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] peer 1::1 as-number 100 [*HUAWEI-bgp] ipv6-family mvpn [*HUAWEI-bgp-af-mvpnv6] peer 1::1 enable [*HUAWEI-bgp-af-mvpnv6] peer 1::1 next-hop-local <HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] peer 10.1.1.2 as-number 100 [*HUAWEI-bgp] ipv6-family mvpn [*HUAWEI-bgp-af-mvpnv6] peer 10.1.1.2 enable [*HUAWEI-bgp-af-mvpnv6] peer 10.1.1.2 next-hop-local