The preference command sets the IS-IS preference.
The undo preference command restores the default IS-IS preference.
The default IS-IS preference is 15.
Parameter | Description | Value |
---|---|---|
preference | Specifies the IS-IS preference. A smaller value indicates a higher preference. | The value is an integer that ranges from 1 to 255. |
route-policy route-policy-name | Specifies the name of a route-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. |
A device may run multiple dynamic routing protocols and there may be multiple routes of different routing protocols to the same destination. Therefore, routing protocols may share and select routing information. To solve this problem, the system sets a preference for each routing protocol. If different protocols discover routes to the same destination, the system selects the route with a higher protocol preference to forward traffic.
The preference command can set the preference of IS-IS routes to affect routing information sharing and selection:
The preference preference command can set the preference for all IS-IS routes.
The preference preference route-policy route-policy-name command can set different preferences for matched and unmatched routes.
The preference route-policy route-policy-name preference command can set the preference for matched routes without affecting the preference of other IS-IS routes.
You can use route-policies to set the preference for specified routes. If the apply preference clause is configured in the route-policy command, the route preference is as follows:
The preference of matched routes is set using the apply clause.
The preference of unmatched routes is set using the preference command.
As shown in the following example, the preference of the routes that pass route-policy abc is set to 50 and the preference of the routes that do not pass the route-policy is set to 30.
#
route-policy abc permit node 1
if-match cost 20
apply preference 50
#
isis 1
preference 30 route-policy abc
If the apply preference 50 clause is not configured in route-policy 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.