The apply cost command sets the MED value for BGP routes or cost value for routes of other protocols.
The undo apply cost command cancels the configuration.
By default, no MED value is set for BGP routes nor cost value is set for routes of other protocols.
Parameter | Description | Value |
---|---|---|
+ |
Increases the route cost. If the link quality is poor or the link bandwidth is low, specify this parameter to increase the route cost, which helps control route selection. |
If the MED of BGP routes or cost of non-BGP routes is greater than the maximum value (4294967295) after the adjustment, 4294967295 takes effect. |
- |
Reduces the route cost. If the link quality is good or the link bandwidth is high, specify this parameter to reduce the route cost, which helps control route selection. |
If the MED of BGP routes or cost of non-BGP routes is less than the minimum value (0) after the adjustment, 0 takes effect. |
cost |
Specifies the route cost. To control route selection, adjust the route cost to prevent routing loops. |
The value is an integer ranging from 0 to 4294967295. |
inherit |
Inherits the original route cost. This function applies to IGP routes, not to BGP routes. |
- |
none |
Delete the MED value of BGP routes. |
- |
Usage Scenario
When the filtering conditions specified in if-match clauses are met, you can run the apply cost command to change the route cost, which helps control route selection. After setting the cost of the routes that match the route-policy, the cost of the imported routes is changed accordingly.
Prerequisites
A route-policy has been configured using the route-policy command.
Configuration Impact
After routes match the route-policy, the cost of the routes is changed.
Precautions
The costs of imported routes are independent of the route-policy after the undo apply cost command is used to cancel the configuration of route costs.