peer next-hop-local (BGP-VPN instance IPv4 address family view)

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.

The undo peer next-hop-local command restores the default setting.

By default:

  • A BGP router sets IP address of the local interface connected to the peer 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 IP address of the local interface connected to the peer 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.
  • A BGP router sets the IP address of the local interface connected to the peer as the next-hop address of the locally originated routes to be advertised to an IBGP peer.

Format

peer ipv4-address next-hop-local

undo peer ipv4-address next-hop-local

Parameters

Parameter Description Value
ipv4-address

Specifies the IPv4 address of a peer.

The value is in dotted decimal notation.

Views

BGP-labeled VPN instance IPv4 address family view, BGP-VPN instance IPv4 address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

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.

When the BGP device advertises routes to an IBGP peer or 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.

Example

# Configure a BGP device to set its IP address as the next hop of routes when advertising the routes to peer.
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpna
[*HUAWEI-vpn-instance-vpna] ipv4-family
[*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*HUAWEI-vpn-instance-vpna-af-ipv4] quit
[*HUAWEI-vpn-instance-vpna] quit
[*HUAWEI] bgp 100
[*HUAWEI-bgp] vpn-instance vpna
[*HUAWEI-bgp-instance-vpna] peer 1.1.1.1 as-number 100
[*HUAWEI-bgp-instance-vpna] quit
[*HUAWEI-bgp] ipv4-labeled-unicast vpn-instance vpna
[*HUAWEI-bgp-labeled-vpna] peer 1.1.1.1 enable
[*HUAWEI-bgp-labeled-vpna] peer 1.1.1.1 next-hop-local
<HUAWEI> system-view
[~HUAWEI] ip vpn-instance vpna
[*HUAWEI-vpn-instance-vpna] ipv4-family
[*HUAWEI-vpn-instance-vpna-af-ipv4] route-distinguisher 100:1
[*HUAWEI-vpn-instance-vpna-af-ipv4] quit
[*HUAWEI-vpn-instance-vpna] quit
[*HUAWEI] bgp 100
[*HUAWEI-bgp] ipv4-family vpn-instance vpna
[*HUAWEI-bgp-vpna] peer 1.1.1.1 as-number 100
[*HUAWEI-bgp-vpna] peer 1.1.1.1 next-hop-local
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >