ip ospf cost track

Use this command to sum the interface speeds contained in the specified tracked object when setting the OSPF interface cost.

Syntax

ip ospf cost track trackobject-name
no ip ospf cost track trackobject-name

Parameters

trackobject-name Specifies the name of the tracked object containing the port names of interfaces to be summed to set the aggregate interface speed when calculating OSPF interface cost.

Defaults

None.

Mode

Configuration command, Interface configuration.

Usage

The formula for calculating the OSPF interface cost metric is the reference bandwidth divided by the interface bandwidth. By default the reference bandwidth is set to 100 Mbps. For logical interfaces containing multiple physical interfaces, such as a LAG, the aggregate interface speed is not readily available. A tracked object configured with the ports belonging to the logical interface can return the physical interface speed of each physical port specified in the tracked object. OSPF will sum the returned interface speeds and use that aggregate value when calculating OSPF interface cost.

Note

Note

The speed used in the cost calculation is sum of all ports capabilities in the tracked object. Setting the speed manually will not change the tracked interface speed. A 1GB capable port has a 1 GB speed regardless of the manual speed setting. The same holds true for ports that auto-negotiate to a lower speed. The expectation is that both sides of the link are using the same ports and SFP connectors and should result in the same speed.

Because the tracked object will report when a physical interface is up or down, OSPF will dynamically adjust the aggregate speed when an interface becomes active or goes down and adjust the OSPF interface cost accordingly.

When adding an additional physical port to a logical interface that uses the interface summation method to determine OSPF interface cost, you must also add the physical port to the associated tracked object.

See Tracked Object Commands“ for tracked object command details.

The “no” form of this command resets the OSPF cost to the value based upon the auto cost setting as set using auto-cost reference-bandwidth.

Example

This example shows how to set the OSPF interface cost for VLAN 1 using the summation method based upon ports configured in track object ospfIntf1:

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