< Home

peer next-hop-local

Function

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:

  • A BGP router sets its interface IP address as the next-hop address of routes when advertising these routes to an EBGP peer.
  • A BGP router does not change the next-hop address of non-labeled routes if the routes are from an EBGP peer and are to be sent to an IBGP peer. The router sets its interface IP address as the next-hop address of labeled routes if the routes are from an EBGP peer and are to be sent to an IBGP peer.
  • A BGP router does not change the next-hop address of routes if the routes are from an IBGP peer and are to be sent to an IBGP peer.

Format

peer { group-name | ipv4-address | ipv6-address } next-hop-local

undo peer { group-name | ipv4-address | ipv6-address } next-hop-local

Parameters

Parameter Description Value

group-name

Specifies the name of a peer group.

The name is a string of 1 to 47 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

ipv4-address

Specifies the IPv4 address of a peer.

It is in dotted decimal notation.

ipv6-address

Specifies the IPv6 address of a peer.

The value is a 32-digit hexadecimal number, in the format of X:X:X:X:X:X:X:X.

  • ipv4-address is valid only in the BGP view, BPG-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPNv6 address family view, BGP-L2VPN address family view, and BGP L2VPN-AD address family view.

  • ipv6-address is valid only in the BGP-IPv6 unicast address family view, and BGP-VPN instance IPv6 address family view.

Views

BGP view, BGP-IPv4 unicast address family view, BGP-IPv4 multicast address family view, BGP-VPN instance IPv4 address family view, BGP-VPNv4 address family view, BGP-IPv6 unicast address family view, BGP-VPN instance IPv6 address family view, BGP-VPNv6 address family view, BGP-L2VPN address family view, BGP L2VPN-AD address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The peer next-hop-local command is usually run on an autonomous system boundary router (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. The next-hop address of a route advertised by an EBGP peer is the address of the EBGP peer. After being forwarded to the IBGP peers, the route cannot become an active route because of the unreachable next hop. The peer next-hop-local command needs to be run to configure the ASBR to change the next hop of the route to its IP address when the ASBR advertises the route to an IBGP peer. Therefore, after being forwarded to the IBGP peer, the route can become an active route because the next hop is reachable.

Prerequisites

The peer as-number command has been used to create a peer or peer group.

Precautions

The peer next-hop-local command is applicable to IBGP peers.

Regarding non-labeled BGP routes on a public network, running the peer next-hop-local command on a route reflector to change the next hop of BGP routes does not take effect.

Regarding labeled BGP routes, running this command on a route reflector to change the next hop of BGP routes takes effect.

Running this command on a local device to change the next hop of routes imported or aggregated by the local device does not take effect.

If a device needs to advertise routes to its IBGP peer or peer group, the peer next-hop-local and peer next-hop-invariable commands are mutually exclusive on the device.

The peer next-hop-local command can be configured in the L2VPN-AD address family view, but the configuration does not take effect.

This command is not supported on RRs in BGP VPNv6 scenarios. If it is incorrectly configured on an RR in a BGP VPNv6 scenario, traffic will be interrupted.

Example

# Configure a BGP device to set its IP address as the next hop of routes when advertising the routes to peer 10.1.1.2.

<HUAWEI> system-view
[HUAWEI] bgp 100
[HUAWEI-bgp] peer 10.1.1.2 as-number 100
[HUAWEI-bgp] ipv4-family unicast
[HUAWEI-bgp-af-ipv4] peer 10.1.1.2 next-hop-local
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >