< Home

apply preference

Function

The apply preference command sets the action for changing the preference of routes in a routing policy.

The undo apply preference command restores the default setting.

By default, the action for changing the preference of routes is not set in a routing policy.

Format

apply preference preference

undo apply preference

Parameters

Parameter Description Value
preference Specifies the route precedence. Route sharing and route selection are difficult because multiple routing protocols can run on the device at the same time; therefore, a default preference needs to be specified for each routing protocol. When different protocols discover multiple routes to the same destination, the route discovered by the protocol with a higher preference is selected to forward IP packets. The smaller the preference value, the higher the preference. The value is an integer ranging from 1 to 255.

Views

Route-Policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To change the preference of routes for selecting the optimal route, you can apply a routing policy containing the apply preference command.

Prerequisites

The apply preference command can be used only after the route-policy command is used.

Precautions

When a routing policy takes effect, it affects route selection.

Example

# Set the preference for routes.

<HUAWEI> system-view
[HUAWEI] route-policy policy permit node 10
[HUAWEI-route-policy] apply preference 90
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >