< Home

default-cost (OSPF)

Function

The default-cost command sets the cost of the Type-3 default route that is transmitted to the stub or Not-So-Stubby Area (NSSA) by OSPF.

The undo default-cost command restores the default setting.

By default, the cost of the Type-3 default route transmitted to the stub or NSSA is 1.

Format

default-cost cost

undo default-cost

Parameters

Parameter Description Value
cost Specifies the cost of the Type-3 default route transmitted to the stub or NSSA by OSPF. The value is an integer ranging from 0 to 16777214.

Views

OSPF area view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

By configuring the cost of the default route, you can change OSPF routing and deploy a network based on your needs.

This command is only applicable to ABRs connected to the stub or NSSA.

Prerequisites

The local routing table contains the default route.

Example

# Set Area 1 as a stub area, and set the cost of the Type-3 default route transmitted to this stub area to 20.

<sysname> system-view
[sysname] ospf 100
[sysname-ospf-100] area 1
[sysname-ospf-100-area-0.0.0.1] stub
[sysname-ospf-100-area-0.0.0.1] default-cost 20
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >