< Home

apply ip-address next-hop (Route-Policy view)

Function

The apply ip-address next-hop command sets the next hop address of a route.

The undo apply ip-address next-hop command cancels the configuration.

By default, no next hop address is set.

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

Sets the next hop address to the local address when the apply clause is used by an export policy.

Sets the next hop address to the peer address when the apply clause is used by an import policy.

-

Views

Route-policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The apply ip-address next-hop command sets the next hop address of a route.

In BGP, the next hop address of a route can be set through the route-policy in the following situations:
  • IBGP

    For an IBGP peer, the configured import and export policies can take effect. If the next hop address configured in the policy is unreachable, the IBGP peer still adds the route to the BGP routing table, but the route is not valid.

  • EBGP

    For an EBGP peer, when the policy is used to modify the next hop address of a route, the import policy is configured. If the export policy is configured, the route is discarded because its next hop is unreachable.

Prerequisites

The apply ip-address next-hop command can be used only after the route-policy command is used.

Configuration Impact

If a BGP route matches a route-policy, you can change the next hop address for the BGP route.

Precautions

When a route-policy is specified in the import-route and network commands, the apply ip-address next-hop clause in the route-policy does not take effect.

Example

# Define an apply clause to set the next hop address as 192.168.1.8.

<sysname> system-view
[sysname] route-policy policy permit node 10
[sysname-route-policy] apply ip-address next-hop 192.168.1.8

# Define an apply clause to set the next hop address to the peer address.

<sysname> system-view
[sysname] route-policy policy permit node 10
[sysname-route-policy] apply ip-address next-hop peer-address
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >