ip ospf cost
Use this command to explicitly specify the cost of the link-state metric in a router-LSA.
The interface cost indicates the overhead required to send packets across an interface. This cost is stated in the Router-LSA’s link. The cost is inversely proportional to the bandwidth of an interface. By default, the cost of an interface is calculated based on the bandwidth (108/ bandwidth). Use this command to set the cost manually.
Use the no parameter with this command to reset the cost to its default value.
Command Syntax
ip ospf (A.B.C.D|) cost <1-65535>
no ip ospf (A.B.C.D|) cost
Parameters
A.B.C.D
The IP address of the interface.
<1-65535>
Specify the link-state metric.
Default
By default, the cost of an interface is calculated based on the bandwidth (108/ bandwidth). The default cost value is 10.
Command Mode
Interface mode
Applicability
This command was introduced before OcNOS version 1.3.
Examples
The following example shows setting the cost as 10 on interface eth0 for IP address 10.10.10.50.
#configure terminal
(config)#interface eth0
(config-if)#ip ospf 10.10.10.50 cost 10
Last modified date: 08/28/2023