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 advertising an imported IGP route to an IBGP peer, a BGP speaker uses the next hop address of the IGP route.
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 the BGP speaker to retain the original Next_Hop 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:
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. |
include-static-route |
Configures the BGP speaker to retain the original Next_Hop of static routes when advertising the routes to the peer. |
- |
include-unicast-route |
Configures the device to retain the original Next_Hop of unicast routes learned from peers when advertising the routes. |
- |
Usage Scenario
In an inter-AS VPN Option C scenario where a VPNv4 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 peers. This ensures that the remote PE recurses routes to the LSP destined for 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 static route is invalid, the public network static route recurses to a VPN route, 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. After the peer next-hop-invariable include-unicast-route command is run, the BGP speaker retains the original Next_Hop 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 group.
Precautions
The peer next-hop-invariable command is valid only for received routes. In the IPv4 unicast address family view, this command is valid only for the received labeled IPv4 unicast routes, and is invalid for 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 peer groups, the peer next-hop-invariable command and the peer next-hop-local command are mutually exclusive.<HUAWEI> system-view [~HUAWEI] bgp 100 [*HUAWEI-bgp] group test external [*HUAWEI-bgp] peer test as-number 200 [*HUAWEI-bgp] peer test next-hop-invariable include-static-route