direct-route cost

Function

The direct-route cost command configures a cost for routes to the directly connected network segment on an interface.

The undo direct-route cost command restores the default configuration.

By default, the cost of routes to the directly connected network segment on interfaces is 0.

Format

direct-route cost cost

undo direct-route cost

Parameters

Parameter Description Value
cost

Specifies the cost of routes to the directly connected network segment on an interface.

The value is an integer ranging from 1 to 4294967295.

Views

Global VE sub-interface view, VE sub-interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
route-base write

Usage Guidelines

Usage Scenario

After the direct-route cost command is run on an L3VE sub-interface, the cost of routes to the directly connected network segment on the L3VE sub-interface becomes the configured value. For configurations details, see Configuration-IP Routing Basis Configuration-Configuring AGGs to Load-Balance RNC-to-CSG Traffic.

Precautions

Both the direct-route cost and direct-route track pw-state, direct-route track vrrp, or direct-route degrade-delay commands can be run.

  • If both the direct-route cost and direct-route track pw-state commands are run, the cost of routes to the directly connected network segment is calculated according to the following rules:
    • If the PW is active, the cost is the value configured using the direct-route cost command.
    • If the PW is standby or Down, the cost is the value configured using the direct-route cost command plus that configured using the direct-route track pw-state command. If the calculated cost is greater than the maximum value (4294967295), 4294967295 takes effect.
  • If both the direct-route cost and direct-route track vrrp commands are run, the cost of routes to the directly connected network segment is calculated according to the following rules:
    • If the device is the master of the VRRP group, the cost is the value configured using the direct-route cost command.
    • If the device is a backup device of the VRRP group, the cost is the value configured using the direct-route cost command plus that configured using the direct-route track vrrp command. If the calculated cost is greater than the maximum value (4294967295), 4294967295 takes effect.
  • If both the direct-route cost and direct-route degrade-delay commands are run and the L3VE sub-interface goes from Down to Up, the cost of routes to the directly connected network segment is calculated according to the following rules:
    • After the delay expires, the cost is the value configured using the direct-route cost command.
    • Before the delay expires, the cost is the value configured using the direct-route cost command plus that configured using the direct-route degrade-delay command. If the calculated cost is greater than the maximum value (4294967295), 4294967295 takes effect.

Example

# Set the cost of routes to the directly connected network segment on a sub-interface to 30 when the sub-interface is Up.
<HUAWEI> system-view
[~HUAWEI] interface virtual-ethernet0/1/8
[*HUAWEI-Virtual-Ethernet0/1/8] ve-group 1 l3-access
[*HUAWEI-Virtual-Ethernet0/1/8] commit
[~HUAWEI-Virtual-Ethernet0/1/8] quit
[~HUAWEI] interface virtual-ethernet0/1/8.1
[*HUAWEI-Virtual-Ethernet0/1/8.1] direct-route cost 30
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >