The preference command sets a priority for OSPF routes.
The undo preference command restores the default value.
By default, the priority of OSPF routes is 10. When ASE is specified, the default value is 150.
Parameter | Description | Value |
---|---|---|
preferencevalue |
Specifies a priority of OSPF routes. The smaller the priority value, the higher the priority. |
The value of the priority is an integer ranging from 1 to 255. |
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. |
ase |
Sets a priority for AS external routes. |
- |
intra |
Sets a priority for intra-area routes. |
- |
inter |
Sets a priority for inter-area routes. |
- |
Usage Scenario
Multiple dynamic routing protocols can be run on a device. The system needs to set a default priority for each routing protocol. If different protocols have routes to the same destination, the protocol with the higher priority is selected to forward IP packets. To set a priority for OSPF routes, run the preference command.
You can apply a route-policy to set the priority of a specific route by setting route-policy in the preference command:Configuration Impact
When there are routes discovered by multiple routing protocols on the same router, you can enable the router to prefer OSPF routes by setting highest priority for them.