Command Reference OSPFv2 Commands
2.25 ip ospf cost
Use this command to configure the cost (OSPF metric) of the OSPF interface for sending a packet in
interface configuration mode. Use the no form of this command to restore the default setting.
OSPF interface cost in the range from 0 to 65535
The default interface cost is calculated as follows:
Reference bandwidth/Bandwidth
The reference bandwidth is 100 Mbps by default.
Interface configuration mode
By default, the OSPF interface cost is 100Mbps/Bandwidth, where Bandwidth is the interface
bandwidth configured with the bandwidth command in interface configuration mode.
The default costs of different types of lines are as follows:
 64K serial line: 1562
 E1 line: 48
 10M Ethernet: 10
 100M Ethernet: 1
The OSPF cost configured with the ip ospf cost command will overwrite the default configuration.
The following example configures the OSPF cost of fastEthernet 0/1 to100.
Ruijie(config)# interfacefastEthernet0/1
Ruijie(config-if-FastEthernet 0/1)# ipospfcost100
Specifies the interface bandwidth. This setting
does not affect the data transmission rate.
Displays the OSPF global configuration
information