You can specify the cost of an OSPF link by configuring the cost of an OSPF interface.
To configure the cost of an OSPF link, you can directly configure the cost of an OSPF interface.
If you do not set the cost of the OSPF interface directly, OSPF calculates the cost according to the bandwidth of the interface. The calculation formula is as follows: cost of the interface = bandwidth reference value/interface bandwidth. The integer of the calculated result is the cost of the interface. If the result is smaller than 1, the cost value is 1. You can indirectly change the cost of the interface by changing the bandwidth reference value.