ip ospf cost

Use this command to statically set the cost of sending an OSPF packet on an interface.

Syntax

ip ospf cost cost
no ip ospf cost cost

Parameters

cost Specifies the cost of sending a packet. Valid values range from 1 to 65535. The default value is the reference bandwidth divided by the interface bandwidth.

Defaults

None.

Mode

Configuration command, Interface configuration.

Usage

Each router interface that participates in OSPF routing is assigned a default cost. This command overwrites the default OSPF interface cost.

The reference bandwidth defaults to 100Mbps and can be modified using auto-cost reference-bandwidth.

The “no” form of this command resets the OSPF cost to the default of 10.

Example

This example shows how to set the OSPF cost to 20 for VLAN 1:

System(rw-config)->interface vlan 1
System(rw-config-intf-vlan.0.1)->ip ospf cost 20