The apply preference command sets a priority for routes.
The undo apply preference command cancels the configuration.
By default, no priority is set for routes.
Parameter | Description | Value |
---|---|---|
preference |
Specifies the route priority. Devices need to be shared and selected when multiple routing protocols run on the device; therefore, a default priority needs to be specified for each routing protocol. When different protocols discover multiple routes to the same destination, the route discovered by the protocol with a higher priority is selected to forward IP packets. The smaller the priority value, the higher the priority. |
The value is an integer ranging from 1 to 255. |
Usage Scenario
If a route matches the filtering conditions specified in the if-match clause, you can run the apply preference command to change the priority of the route for route selection. When different protocols discover multiple routes to the same destination, the route discovered by the protocol with a higher priority is selected to forward IP packets.
Prerequisites
A route-policy has been configured using the route-policy command.
Configuration Impact
After a route matches a route-policy, the priority of the route is changed.
Precautions
Currently, a route-policy cannot be applied to set the BGP preference of routes advertised to or accepted from a BGP peer using the peer route-policy command. Instead, the preference route-policy command can be run in the BGP view to change the BGP preference globally.