The peer next-hop-invariable command configures PEs in different ASs not to change next hops of routes when the PEs advertise them to their EBGP peers, and configures the PEs to use the next hops of imported IGP routes when the PEs advertise them to their IBGP peers.
The undo peer next-hop-invariable command restores the default setting.
By default, when advertising routes to its EBGP peers and imported IGP routes to IBGP peers, a BGP speaker changes the next hop to its interface address.
peer { ipv4-address | group-name } next-hop-invariable
undo peer { ipv4-address | group-name } next-hop-invariable
Parameter | Description | Value |
---|---|---|
ipv4-address | Specifies the IPv4 address of a peer. | It is in dotted decimal notation. |
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. |
BGP view, BGP-IPv4 unicast address family view, BGP-VPNv4 address family view, BGP-VPNv6 address family view, BGP-L2VPN address family view, BGP-VPLS address family view, BGP L2VPN-AD address family view, BGP-EVPN address family view
Usage Scenario
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 the route to its IBGP peers, and does not change the next hop of a route when advertising it to its EBGP peers.
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 an EBGP peer. This ensures that the remote PE iterates a route to the BGP 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 the route 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.
# Configure a BGP device not to change the next hop of a route when the BGP device advertises it to its EBGP peer.
<HUAWEI> system-view [HUAWEI] bgp 100 [HUAWEI-bgp] peer 10.1.1.2 as-number 200 [HUAWEI-bgp] ipv4-family vpnv4 [HUAWEI-bgp-af-vpnv4] peer 10.1.1.2 enable [HUAWEI-bgp-af-vpnv4] peer 10.1.1.2 next-hop-invariable
# Use the next hop of an IGP route when advertising the IGP route to IBGP peers.
<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-invariable