< Home

default-cost (OSPF Area)

Function

The default-cost command sets a cost for the Type3 default route that is transmitted to a stub or NSSA by OSPF.

The undo default-cost command restores the default setting.

By default, the cost of the Type3 default route transmitted to a stub or NSSA is 1.

Format

default-cost cost

undo default-cost

Parameters

Parameter Description Value
cost Specifies the cost of the Type3 default route transmitted to a 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

Configuring a cost for a default route can change OSPF route selection, improving networking flexibility.

This command is applicable to area border routers (ABRs) connected to stubs or NSSAs.

Prerequisites

A default route exists in the local routing table.

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.

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