< Home

peer next-hop-invariable

Function

The peer next-hop-invariable command has the following functions:
  • Configures route reflectors (RRs) of different ASs to advertise routes to EBGP peers without changing next hops.
  • Configures devices to advertise labeled routes to IBGP peers without changing next hops.
  • Configures devices to advertise IGP routes to IBGP peers using next hops of the IGP routes.

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

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.
  • A BGP router sets its interface IP address as the next-hop address of routes when advertising imported IGP routes to IBGP peers.

Format

peer { ipv4-address | group-name } next-hop-invariable

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

Parameters

Parameter Description Value

ipv4-address

Specifies the IPv4 address of a peer.

It is in dotted decimal notation.

group-name

Specifies the name of the peer group.

The name is a string of 1 to 47 characters without any space. It is case-sensitive.

Views

BGP view, BGP-IPv4 unicast address family view, BGP-VPNv4 address family view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

In the inter-AS VPN option C networking where an RR is used, the peer next-hop-invariable command needs to be run to configure the RR not to change the next-hop address of a route when advertising the route to a peer. This ensures that the remote PE iterates a route to the label switched path (LSP) destined for the local PE during traffic transmission.

Prerequisites

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

Configuration Impact

After the peer next-hop-invariable command is used on a device, the device does not change the next hop of an imported IGP route when advertising it to its IBGP peers, and does not change the next hop of a route when advertising it to its EBGP peers.

Precautions

The peer next-hop-invariable command configured on EBGP peers takes effect only for VPNv4 and VPNv6 routes.

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

Example

# The BGP router does not change the next hop when advertising routes to the EBGP peers.
<sysname> system-view
[sysname] bgp 100 
[sysname-bgp] peer 1.1.1.2 as-number 200 
[sysname-bgp] ipv4-family vpnv4 
[sysname-bgp-af-vpnv4] peer 1.1.1.2 enable
[sysname-bgp-af-vpnv4] peer 1.1.1.2 next-hop-invariable

# Use the next hop of an IGP route when advertising the IGP route to IBGP peers.

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