The preference command sets the preference of IS-IS.
The undo preference command restores the default value.
By default, the preference of IS-IS is 15.
| Parameter | Description | Value |
|---|---|---|
| preference | Specifies the preference. The smaller the value is, the higher the preference level is. | The value is an integer ranging from 1 to 255. |
| route-policy route-policy-name | Specifies the name of the routing policy. | The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string. |
Usage Scenario
Multiple dynamic routing protocols may be run on a router at the same time, so routes discovered by various routing protocols to the same destination may exist. In this case, there is a problem of route sharing and selecting among routing protocols. To solve this problem, you can use the preference command to set a default preference for each routing protocol. If different protocols have routes to the same destination, the protocol with the higher preference is selected to forward IP packets.
The preference preference, you can set the preference for all routes of IS-IS.
The preference preference route-policy route-policy-name or preference route-policy route-policy-name preference command sets different preferences for matched and unmatched routes.
The preference route-policy route-policy-name, you can set preference for matched routes, which does not affect the preferences of other IS-IS routes.
Prerequisites
Before configuring the preference command, run the isis command to create an IS-IS process and enter the IS-IS view.
Precautions
Set the preference for specific routes by using the route-policy command. If the apply preference command is configured in the route-policy command, the preference of the route is divided as follows:
Matched routes: its preference is set by the apply clause.
Unmatched routes: its preference is set by the preference command.
As shown in the following example:
#
route-policy abc permit node 1
if-match cost 20
apply preference 50
#
isis 1
preference 30 route-policy abc
The preference of routes that pass the policy named abc is set to 50, and the preference of routes that do not pass the policy named abc is set to 30.
If the apply preference 50 is not configured in the policy named abc, the preference of all routes is set to 30.
Creating a route-policy before it is referenced is recommended. By default, nonexistent route-policies cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command, the configured priority applies to all IS-IS routes.