The rule for calculating an OSPF interface cost is as follows: The cost configured on the interface is preferred. If no cost is configured on the interface, OSPF calculates the cost by dividing the bandwidth reference value by the interface bandwidth.
The default reference bandwidth of OSPF is 100 Mbit/s.
For example, the cost of a 10M Ethernet interface is 10 Mbit/s (100/10).
If the calculation result is less than 1, the cost is set to 1. For example, the cost of a 1 Gbit/s GE interface is calculated by dividing 100 Mbit/s by 1000 Mbit/s. In this case, the cost value is set to 1.