peer next-hop-invariable (BGP-VPNv4 address family view) (group)

Function

The peer next-hop-invariable command has the following functions:

- When the BGP speaker advertises routes to EBGP peers, the BGP speaker does not change the Next_Hop.

- When the BGP speaker advertises labeled routes to IBGP peers, the BGP speaker does not change the Next_Hop.

- When the BGP speaker advertises imported IGP routes to IBGP peers, the BGP speaker changes the Next_Hop to the Next_Hops of the IGP routes.

The undo peer next-hop-invariable command restores the default configuration.

By default:

  • A device sets its interface IP address as the Next_Hops of routes when advertising these routes to EBGP peers.
  • A device does not modify the Next_Hops of non-labeled routes if the routes are learned from EBGP peers and are to be advertised to IBGP peers; the device sets its interface IP address as the Next_Hops of labeled routes if the routes are learned from EBGP peers and are to be advertised to IBGP peers.
  • A device does not change the Next_Hops of routes if the routes are learned from an IBGP peer and are to be advertised to another IBGP peer.
  • A device sets its interface IP address as the Next_Hops of routes when advertising imported IGP routes to IBGP peers.
  • A device modifies the Next_Hop of imported static routes to the local interface's IP address when advertising the routes to IBGP peers.

Format

peer group-name next-hop-invariable

undo peer group-name next-hop-invariable

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.

Views

BGP-VPNv4 address family view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
bgp write

Usage Guidelines

Usage Scenario

In an inter-AS VPN Option C scenario where an VPNv4 Route Reflector (RR) is used, the peer next-hop-invariable command needs to be run on the RR to prevent the RR from modifying the Next_Hops of routes before advertising the routes to EBGP peers. This ensures that the remote PE recurses routes to the LSP destined for the local PE during traffic transmission.

Prerequisites

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

Precautions

The peer next-hop-invariable command takes effect only for received routes. However, the configuration does not take effect for received IPv4 routes that do not carry labels.

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

Example

# Configure the BGP speaker to retain the original Next_Hop of imported static routes when advertising the routes to an IBGP peer group.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[~HUAWEI-bgp] group a internal
[~HUAWEI-bgp] ipv4-family vpnv4
[~HUAWEI-bgp-af-vpnv4] peer a enable
[~HUAWEI-bgp-af-vpnv4] peer a next-hop-invariable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >