Chapter 50
| IP Routing Commands
Open Shortest Path First (OSPFv2)
– 1024 –
ip ospf cost This command explicitly sets the cost of sending a protocol packet on an interface,
where higher values indicate slower ports. Use the no form to restore the default
value.
Syntax
ip ospf [ip-address] cost cost
no ip ospf [ip-address] cost
ip-address - This parameter can be used to indicate a specific IP address
connected to the current interface. If not specified, the command applies
to all networks connected to the current interface.
cost - Link metric for this interface. Use higher values to indicate slower
ports. (Range: 1-65535)
Command Mode
Interface Configuration (VLAN)
Default Setting
1
Command Usage
â—† The interface cost indicates the overhead required to send packets across a
certain interface. This is advertised as the link cost in router link state
advertisements.
â—† Routes are assigned a metric equal to the sum of all metrics for each interface
link in the route.
â—† This router uses a default cost of 1 for all port types. Therefore, if any VLAN
contains 10 Gbps ports, you may want to reset the cost for other VLANs which
do not contain 10 Gbps ports to a value greater than 1.
Example
Console(config)#interface vlan 1
Console(config-if)#ip ospf cost 10
Console(config-if)#