ip ospf cost

Configures cost for a specific interface.

ip ospf cost value
no ip ospf cost

Cost value is 1.

value
Cost value. Valid values range from 1 through 65535. The default is 1.

Interface subtype configuration mode

Use this command to set or reset the OSPFv2 cost on the interface. If the cost is not configured with this command, OSPFv2 calculates the value from the reference and interface bandwidths.

You can modify the cost to differentiate between 100 Mbps, 1 Gbps, and 10 Gbps. The default cost is calculated by dividing 100 million by the bandwidth. For 10 Mbps links, the cost is 10. The cost for 100 Mbps, 1 Gbps, and 10 Gbps links is 1, because the speed of 100 Mbps and 10 Gbps was not in use at the time the OSPF cost formula was devised.

The no form of the command disables the configured cost.

The following example sets the cost to 600 on a specific OSPFv2 Virtual Ethernet (VE) interface.


device# configure terminal
device(config)# interface ve 1
device(config-vif-11)# ospf cost 600