peer next-hop-invariable (BGP view)

Function

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

- The BGP speaker does not change the next hop when advertising routes to EBGP peers.

- The BGP speaker does not change the next hop when advertising labeled routes to IBGP peers.

- When the BGP speaker advertises imported IGP routes to IBGP peers, the BGP speaker uses the next hop address of the IGP routes.

The peer next-hop-invariable include-static-route command configures a BGP speaker to retain the original Next_Hop of imported static routes when advertising the routes to an IBGP peer.

The peer next-hop-invariable include-unicast-route command configures a BGP speaker not to change the next hop address when advertising to an EBGP peer the unicast routes learned from another peer.

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

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 ipv4-address next-hop-invariable [ include-static-route | include-unicast-route ] *

undo peer ipv4-address next-hop-invariable

Parameters

Parameter Description Value
ipv4-address

Specifies the IPv4 address of a peer.

It is in dotted decimal notation.

include-static-route

Configures the BGP speaker to retain the original Next_Hop of imported static routes when advertising the routes to the peer.

-

Views

BGP-IPv4 unicast address family view, BGP 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 VPNv4 RRs are deployed, the peer next-hop-invariable command needs to be run on the RRs to prevent them from changing the next hop address of a route before they advertises the route to a peer. This ensures that the remote PE can implement recursion to the LSP to the local PE during traffic transmission.

If the peer next-hop-invariable include-static-route command is run, the BGP speaker retains the original next hop address of an imported public network static route when advertising the route to an IBGP peer under the condition that the original next hop address is valid; if the original next hop address of the public network static route is invalid, the next hop of the public network static route belongs to a VPN instance, or the public network static route is imported from a VPN instance, the BGP speaker uses its interface address as the next hop of the route.

If the peer next-hop-invariable include-unicast-route command is run, the BGP speaker does not change the next hop address when advertising to an EBGP peer the unicast routes learned from another peer.

Prerequisites

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

Precautions

The peer next-hop-invariable command without the include-static-route keyword configured takes effect only on received routes. In the IPv4 unicast address family view, this command takes effect only on received labeled IPv4 unicast routes, not on the routes that do not carry labels.

After the peer next-hop-invariable include-static-route command is run, you can run the undo peer next-hop-invariable command to restore the default configuration or run the peer next-hop-invariable [ include-unicast-route ] command to override the previous configuration.

After the peer next-hop-invariable include-unicast-route command is run, you can run the undo peer next-hop-invariable command to restore the default configuration or run the peer next-hop-invariable [ include-static-route ] command to override the previous configuration.

When routes are advertised to IBGP peers, the peer next-hop-invariable command and the peer next-hop-local command are mutually exclusive.

Example

# Configure the BGP speaker to retain the original Next_Hop of imported static routes when advertising the routes to an IBGP peer.
<HUAWEI> system-view
[~HUAWEI] bgp 100
[*HUAWEI-bgp] peer 10.1.1.2 as-number 100
[*HUAWEI-bgp] peer 10.1.1.2 next-hop-invariable include-static-route
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >