< Home

Setting a Cost for an IS-IS Interface

Configuring the IS-IS interface costs can control IS-IS route selection.

Context

The link cost of an IS-IS interface can be set in the following modes with priorities in descending order:

  • Interface cost: A link cost is set for a single interface.

  • Global cost: A link cost is set for all interfaces.

  • Auto-calculation cost: A link cost of an interface is automatically set based on the interface bandwidth.

Procedure

  • Set an IS-IS cost style.
    1. Access the system view.

      system-view

    2. Access the IS-IS process view.

      isis [ process-id ]

    3. Set the IS-IS cost style.

      cost-style { narrow | wide | wide-compatible | { { narrow-compatible | compatible } [ relax-spf-limit ] } }

    The default cost style is narrow.

    The cost range of an interface and the cost range of a route received by the interface vary with the cost style.

    • If the cost type is narrow, the cost of an interface ranges from 1 to 63. The maximum cost of a route received by the interface is 1023.

    • If the cost style is narrow-compatible or compatible, the cost of an interface ranges from 1 to 63. The cost of a route received by the interface depends on relax-spf-limit.

      • When you do not specify relax-spf-limit,

        • If the cost of the route is not greater than 1023 and the link cost of every interface that the route passes through is smaller than or equal to 63, the cost of the route received by the interface is the actual one.

        • If the cost of the route is not greater than 1023 but the link cost of an interface that the route passes through is greater than 63, the device can learn only the routes to the network segment on which the interface resides and the routes imported by the interface. The cost of the route received by the interface is the actual one. Subsequent routes forwarded by the interface are discarded.

        • If the cost of the route is greater than 1023, the device can learn only the route to the interface whose link cost exceeds 1023 for the first time. The link cost of each interface before this interface is not greater than 63. The device can learn the routes to the network segment on which the interface resides and the routes imported by the interface. The cost of the routes is 1023. Subsequent routes forwarded by the interface are discarded.

      • When you specify relax-spf-limit, there is no limit on link costs of interfaces or route costs, and the cost of the route received by an interface is the actual one.

    • If the cost style is wide-compatible or wide, the interface cost ranges from 1 to 16777215. When the cost of an interface is 16777215, the neighbor TLV generated on the link of the interface cannot be used for route calculation but for TE information transmission. The maximum cost of a received route is 0xFFFFFFFF.

  • Set a cost for an IS-IS interface.
    1. Access the system view.

      system-view

    2. Access the interface view.

      interface interface-type interface-number

    3. Set the cost of the IS-IS interface.

      isis cost { cost | maximum } [ level-1 | level-2 ]

      By default, the link cost of an IS-IS interface is 10.

  • Set a global IS-IS cost.
    1. Access the system view.

      system-view

    2. Access the IS-IS process view.

      isis [ process-id ]

    3. Set the global IS-IS cost.

      circuit-cost { cost | maximum } [ level-1 | level-2 ]

      By default, no global cost is configured.

  • Enable IS-IS to automatically calculate an IS-IS interface cost.
    1. Access the system view.

      system-view

    2. Access the IS-IS process view.

      isis [ process-id ]

    3. Configure the reference value of the bandwidth.

      bandwidth-reference value

      By default, the bandwidth reference value is 100 Mbit/s.

    4. Configure the interface to automatically calculate its cost.

      auto-cost enable

    The bandwidth reference value specified in Step 3 takes effect only when the cost style is wide or wide-compatible. IS-IS calculates a cost for an interface using the formula: Interface cost = (Bandwidth reference value/Interface bandwidth) x 10.

    The auto-cost enable command can be run on Eth-Trunk interfaces as same with on physical interfaces. If the command is run on an Eth-Trunk interface, the bandwidth of the Eth-Trunk interface is equal to the total bandwidth of all its member interfaces.

    When the cost style is narrow, narrow-compatible, or compatible, the cost of each interface is based on Table 1.

    Table 1 Relationship between costs and bandwidths of interfaces

    Interface Cost

    Interface Bandwidth

    60

    Interface bandwidth ≤ 10 Mbit/s

    50

    10 Mbit/s < interface bandwidth ≤ 100 Mbit/s

    40

    100 Mbit/s < interface bandwidth ≤ 155 Mbit/s

    30

    155 Mbit/s < interface bandwidth ≤ 622 Mbit/s

    20

    622 Mbit/s < interface bandwidth ≤ 2.5 Gbit/s

    10

    2.5 Gbit/s < interface bandwidth

    To change the cost of a loopback interface, you can only run the isis cost command in the interface view.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
Next topic >