The ospf cost multi-area command configures a cost for an OSPF multi-area adjacency interface.
The undo ospf cost multi-area command restores the default cost.
By default, the cost is calculated using the Interface cost = Bandwidth reference value/Interface bandwidth formula, in which the bandwidth reference value can be changed using the bandwidth-reference command.
100GE interface view, 10GE interface view, 25GE sub-interface view, 25GE interface view, 400GE interface view, 40GE interface view, 50GE sub-interface view, 50GE interface view, Eth-Trunk interface view, FlexE interface view, GE optical interface view, GE electrical interface view, GMPLS-UNI interface view, Global VE sub-interface view, Tunnel interface view, VBDIF interface view, VE sub-interface view, VLANIF interface view
Usage Scenario
OSPF can automatically calculate the cost for an interface according to the interface bandwidth. The cost can also be configured using the ospf cost command. If multiple routes with the same protocol, cost, and destination IP address are available, they participate in load balancing. You can determine whether load balancing is implemented by changing the cost.
If no cost is configured for a multi-area adjacency interface using the ospf cost multi-area command, OSPF calculates the cost by dividing the bandwidth reference value by the interface bandwidth. The integer of the quotient is used as the cost of the interface. If the quotient is less than 1, the cost is 1. Changing the bandwidth reference value can change the cost of an interface. By default, the bandwidth reference value is 100 Mbit/s. The default cost of Ethernet interfaces is 1 because their interface bandwidth is 100 Mbit/s. NOTE: The bandwidth of each trunk interface is the sum of bandwidth of all member interfaces, and the member interfaces constantly change. Therefore, trunk interfaces have no default cost.Prerequisites
Run the ospf enable multi-area command first.
Precautions
The ospf cost multi-area command does not apply to null interfaces.
<HUAWEI> system-view [~HUAWEI] ospf 1 [*HUAWEI-ospf-1] area 0 [*HUAWEI-ospf-1-area-0.0.0.0] quit [*HUAWEI-ospf-1] area 1 [*HUAWEI-ospf-1-area-0.0.0.1] quit [*HUAWEI-ospf-1] quit [*HUAWEI] interface GigabitEthernet0/1/0 [*HUAWEI-GigabitEthernet0/1/0] ospf enable 1 area 0 [*HUAWEI-GigabitEthernet0/1/0] ospf enable multi-area 1 [*HUAWEI-GigabitEthernet0/1/0] ospf cost 65 multi-area 1