CX320 Switch Module V100R001 Command Reference 14

apply cost

apply cost

Function

The apply cost command sets the action for changing the cost of routes in a routing policy.

The undo apply cost command restores the default setting.

By default, the action for changing the cost of routes is not set in a routing policy.

Format

apply cost { [ apply-type ] cost | inherit }

undo apply cost

Parameters

Parameter Description Value
apply-type Specifies the cost type of routes.
  • +: increases the route cost. If the link quality is poor or the link bandwidth is rather small, you can specify this parameter to increase the route cost, controlling route selection.
  • -: reduces the route cost. If the link quality is good or the link bandwidth is rather great, you can specify this parameter to reduce the route cost, controlling route selection.
cost Specifies the route cost. To control route selection, you can adjust the route cost to prevent routing loops. The value is an integer ranging from 0 to 4294967295.
inherit Inherits the original route cost. -

Views

Route-Policy view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

To change the cost of routes for selecting the optimal route, you can apply a routing policy containing the apply cost command.

Prerequisites

The apply cost command can be used only after the route-policy command is used.

Precautions

When a routing policy takes effect, it affects route selection.

The costs of imported routes are independent of the routing policy after the undo apply cost command is used to cancel the configuration of route costs.

Example

# Define an apply clause to set the route cost to 120.

<HUAWEI> system-view
[~HUAWEI] route-policy policy permit node 10
[*HUAWEI-route-policy] apply cost 120
Translation
Favorite
Download
Update Date:2025-07-01
Document ID:EDOC1000128405
Views:7708237
Downloads:2083
Average rating:4.75Points

Digital Signature File

digtal sigature tool