The apply cost-type command sets the action for changing the cost type of routes in a routing policy.
The undo apply cost-type command restores the default setting.
By default, the action for changing the cost type of routes is not set in a routing policy.
Product |
Support |
---|---|
S5720-EI, S5720-HI, S5720I-SI, S5720S-SI, S5720-SI, S5735-S, S5735S-S, S5735-S-I, S5730-HI, S5730S-EI, S5730-SI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6720S-SI, S6720-SI, S6730-H, S6730S-H, S6730-S, and S6730S-S |
Supported. |
S2720-EI, S5720-LI, S5735-L, S5735S-L, S5735S-L-M, S5720S-LI, S6720-LI, and S6720S-LI |
Not supported. |
Parameter | Description | Value |
---|---|---|
external | Sets the cost type of IS-IS external routes. | - |
internal | Sets the cost type of IS-IS internal routes or sets the MED value of BGP routes as the IGP cost of the next hop. | - |
type-1 | Sets Type 1 external routes of OSPF. | - |
type-2 | Sets Type 2 external routes of OSPF. | - |
Usage Scenario
When the cost-style of an IS-IS device is wide, compatible, or wide-compatible, the cost types of external or internal are classified. When the cost-style of an IS-IS device is narrow or narrow-compatible, the imported route classifies the cost type of external or internal. In other words, the apply cost-type command is valid on IS-IS devices only in the narrow or narrow-compatible modes.
The apply cost-type { type-1 | type-2 } command modifies the type of OSPF routes. During route import, OSPF modifies the type but not the cost value of the original route. When OSPF advertises the imported route with the cost and type information to a peer, the peer device will recalculate the cost value of the imported route based on the received information.
When the filtering conditions specified by if-match clauses are met, you can change the cost type of routes to set the imported external routes all to Type-1 or all to Type-2 by using the apply cost-type command. After the cost type of the routes that match the route-policy is set, the cost type of the routes that are imported by using the route-policy is the set cost type.
Prerequisites
Before running the apply cost-type command, you need to configure a route-policy by route-policy.
Configuration Impact
After routes match the route-policy, the cost type of the routes is changed.
Precautions
When the apply cost-type internal command is applied to IS-IS routes:
Routes are configured as IS-IS internal routes.
When the apply cost-type internal command is applied to BGP routes:
When a switch advertises a route learned from an IBGP peer to an EBGP peer, if the apply cost-type internal command is run, the switch sets the MED value of the route to be advertised to the EBGP peer as the IGP cost of the next hop of the route.