default-metric (OSPF)

Sets the default metric value for the OSPFv2 or OSPFv3 routing protocol.

Syntax

default-metric metric
no default-metric

Parameters

metric
OSPF routing protocol metric value. Valid values range from 1 through 65535. The default is 10.

Modes

OSPF router configuration mode

OSPFv3 router configuration mode

OSPF router VRF configuration mode

OSPFv3 router VRF configuration mode

Usage Guidelines

This command overwrites any incompatible metrics that may exist when OSPFv2 or OSPFv3 redistributes routes. Therefore, setting the default metric ensures that neighbors use the correct cost and router computation.

The no form of the command restores the default setting.

Examples

The following example sets the default metric to 20 for OSPF.

device# configure terminal
device(config)# router ospf
device(config-router-ospf-vrf-default-vrf)# default-metric 20