apply ip-address next-hop (Route-Policy view)
Function
The apply ip-address next-hop command sets the action for changing the next hop address of BGP routes in a routing policy.
The undo apply ip-address next-hop command restores the default setting.
By default, the action for changing the next hop address of BGP routes is not set in a routing policy.
Format
apply ip-address next-hop { ipv4-address | peer-address }
undo apply ip-address next-hop { ipv4-address | peer-address }
Parameters
Parameter | Description | Value |
---|---|---|
ipv4-address | Specifies the next hop address. | It is in dotted decimal notation. |
peer-address | Specifies the peer address as the next hop. | - |
Usage Guidelines
Usage Scenario
To change the next hop address of BGP routes for selecting the optimal route, you can apply a routing policy containing the apply ip-address next-hop command.
The next hop address of a BGP route is set using the policy in the following situations:
IBGP: Configure the import or export policy for the IBGP peer. If the next hop address configured in the routing policy is unreachable, the IBGP peer adds the corresponding route to the BGP routing table. However, this route is invalid.
EBGP: Configure the import policy for the EBGP peer. If an export policy is configured, the route destined for the EBGP peer is discarded because the next hop address is unreachable. When EBGP peers are directly connected, the routing policy does not take effect. This means that the next hop address remains unchanged.
Prerequisites
The apply ip-address next-hop command can be used only after the route-policy command is used.
Precautions
When a routing policy takes effect, it affects BGP route selection.
When a routing policy is specified in the import-route and network commands, the apply ip-address next-hop clause in the routing policy does not take effect.