preference (IS-IS view)

Function

The preference command sets a priority for IS-IS.

The undo preference command restores the default value.

By default, the priority of IS-IS is 15.

Format

preference { { route-policy route-policy-name | route-filter route-filter-name } | preference } *

undo preference

Parameters

Parameter Description Value
route-policy route-policy-name

Specifies the name of a route-policy.

The name is a string of 1 to 200 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

route-filter route-filter-name

Specifies the name of route filter policy.

The value is a string of 1 to 200 case-sensitive characters, spaces not supported. If parameters are included in the referenced route-filter, specify values for them in the format of (var1, var2, ...var8) behind the route-filter name. A maximum of eight parameters can be specified, and each value ranges from 1 to 200 characters.

preference

Specifies a priority of the IS-IS protocol. The smaller the value, the higher the priority.

The value is an integer that ranges from 1 to 255.

Views

IS-IS view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
isis write

Usage Guidelines

Usage Scenario

Multiple dynamic routing protocols may be run on a device, and routes discovered by various routing protocols to the same destination may exist. In this case, you can use the preference command to set a default priority for each routing protocol. If different protocols have routes to the same destination, the protocol with the highest priority is selected for IP packet forwarding.

The preference command sets a priority for IS-IS or some IS-IS routes. The preference command is used in the following three ways:

  • The preference command sets a priority for all IS-IS routes.
  • The preference preference route-policy route-policy-name, preference preference route-filter route-filter-name, preference route-filter route-filter-name preference or preference route-policy route-policy-name preference command sets different priorities for matched and unmatched routes.
  • The preference route-policy route-policy-name or preference route-filter route-filter-name command sets a priority only for matched routes.

Prerequisites

An IS-IS process has been created and the IS-IS view has been displayed using the isis command.

Precautions

If an apply clause is configured for a route-policy using the apply preference command, the priorities are used as follows:

  • Matched routes: The priority set using the apply preference command is used.
  • Unmatched routes: The priority set using the preference command is used.

    In the following example, the priority of the routes that match the route-policy named abc is set to 50, and the priority of the routes that fail to match the route-policy named abc is set to 30.
<h1 id="id"></h1>

route-policy abc permit node 1

if-match cost 20

apply preference 50

<h1 id="id-1"></h1>

isis 1

preference 30 route-policy abc

If the apply preference 50 command is not run for the route-policy named abc, the priority of all routes is set to 30.

Several dynamic protocols can run on a device. In this case, set a priority for each protocol. When routes to the same destination learned from different protocols are available, the one with the highest priority is selected.

Example

# Set the priority of IPv4 IS-IS to 25.
<HUAWEI> system-view
[~HUAWEI] isis
[*HUAWEI-isis-1] preference 25
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >