You can adjust and optimize route selection by setting the OSPF interface cost.
After the OSPF interface costs are set, the interface with a smaller cost value preferentially transmits routing information. This helps select the optimal route.
The OSPF interface cost can be set or calculated based on the interface bandwidth.
External factors may affect the physical bandwidth of links and change the physical bandwidth of interfaces, which in turn affects network performance. To address this problem, you can run the bandwidth bandwidth command in the interface view to set configuration bandwidth for the interface, and then run the bandwidth-config enable command to enable the device to calculate the cost for the OSPF interface based on the configuration bandwidth of the interface.
The calculation formula is as follows:
. The integer of the calculation result is used as the cost of the interface. If the result is less than 1, the cost is 1.Perform the following operations as required: