ospf cost (interface view)

Use ospf cost to set an OSPF cost for an interface.

Use undo ospf cost to restore the default.

Syntax

ospf cost cost-value

undo ospf cost

Default

An interface computes its OSPF cost according to the interface bandwidth. For a loopback interface, the cost is 0.

Views

Interface view

Predefined user roles

network-admin

Parameters

cost-value: Specifies an OSPF cost in the range of 0 to 65535 for a loopback interface, and in the range of 1 to 65535 for other interfaces.

Usage guidelines

If you do not execute this command, the interface automatically computes its OSPF cost.

Examples

# Set the OSPF cost on VLAN-interface 10 to 65.

<Sysname> system-view
[Sysname] interface vlan-interface 10
[Sysname-Vlan-interface10] ospf cost 65

Related commands

bandwidth-reference