The apply cost-type command sets the cost type of a route.
The undo apply cost-type command cancels the configuration.
By default, no cost type of a route is set.
Parameter | Description | Value |
---|---|---|
external |
Sets the cost type to IS-IS external. |
- |
internal |
Sets the cost type to IS-IS internal or sets the MED of a BGP route to the cost of the IGP route to which the BGP route recurses. This parameter takes effect only on EBGP peers. |
- |
type-1 |
Sets the cost type to OSPF external Type 1. |
- |
type-2 |
Sets the cost type to OSPF external Type 2. |
- |
internal-inc-ibgp |
Sets the cost type to IS-IS internal or enables the MED of a BGP route to inherit the cost of the IGP route to which the BGP route recurses. This parameter takes effect both on EBGP and IBGP peers. |
- |
med-plus-igp |
Sets the MED of a BGP route by adding the original MED to the cost of the IGP route to which the BGP route recurses. This parameter takes effect both on EBGP and IBGP peers. |
- |
med-inherit-aigp |
Enables the MED of a BGP route to inherit the AIGP. This parameter takes effect both on EBGP and IBGP peers. The policy applies only to BGP VPN peers. |
- |
Usage Scenario
To set the cost type for the routes that match an if-match clause, run the apply cost-type command. After the cost type of the routes that match a route-policy is set, the routes that are imported using the route-policy carry the set cost type.
Prerequisites
A route-policy has been configured using the route-policy command.
Configuration Impact
After routes match the route-policy, the cost type of the routes is changed.
Precautions
Different operations are performed when the apply cost-type { internal | internal-inc-ibgp } command is applied to IS-IS routes and BGP routes:
<HUAWEI> system-view [~HUAWEI] route-policy policy permit node 10 [*HUAWEI-route-policy] apply cost-type med-inherit-aigp
<HUAWEI> system-view [~HUAWEI] route-policy policy permit node 10 [*HUAWEI-route-policy] apply cost-type type-1