< Home

apply preference

Function

The apply preference command sets the preference for routes.

The undo apply preference command cancels the configuration.

By default, the preferences of routes are not set.

Format

apply preference preference

undo apply preference

Parameters

Parameter Description Value
preference Specifies the route preference. The value is an integer ranging from 1 to 255. The smaller the value is, the higher the preference is.

Views

Route-policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If a route satisfies the filter condition specified by the if-match clause, you can run the apply preference command to change the preference of the route to participate in route selection. Then, when different protocols discover multiple routes to the same destination, the route discovered by the protocol with a higher preference is selected as a valid route to forward packets.

Prerequisites

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

Configuration Impact

After a route matches a route-policy, you can change the preference of the route.

Example

# Set the preference for routes.

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