< Home

default (OSPF)

Function

The default command configures default parameters for OSPF-imported external routes. The parameters include the cost, type (Type 1 or Type 2), tag, and number of imported routes.

The undo default command restores the default setting.

By default, the default cost of the imported external routes is 1; the upper limit of the imported external routes is 2147483647; the type of the imported external routes is Type 2; the default tag value is 1.

Format

default { cost { cost-value | inherit-metric } | limit limit | tag tag | type type } *

undo default { cost | limit | tag | type } *

Parameters

Parameter Description Value
cost cost-value Specifies the default cost of the external routes imported by OSPF. The value is an integer ranging from 0 to 16777214. By default, it is 1.
inherit-metric Indicates that the cost of the imported route is the cost that the route itself carries. If no cost is specified, the default cost set using the default command is used. -
limit limit Specifies the default upper limit of the external routes to be imported within a given period. The value is an integer ranging from 1 to 2147483647.
tag tag Specifies the tag of the external routes. The value is an integer ranging from 0 to 4294967295. By default, it is 1.
type type Specifies the type of the external routes.
The value is an integer ranging from 1 to 2. By default, it is 2.
  • 1: Type 1 external route
  • 2: Type 2 external route

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

The imported external routes carry various parameters that can change the priorities and next hops of those routes in the OSPF routing table.

By setting default parameters for OSPF-imported external routes, you can change OSPF routing policies.

The route tag is used to identify protocol-related information. For example, it can be used to differentiate AS numbers when OSPF receives BGP routes. It also allows you to apply OSPF routing policies to tagged routes.

Follow-up Procedure

The priority of the default (OSPF) command is the lowest. Thus, ensure that no other commands are configured when configuring this command. Otherwise, this command cannot take effect.

Precautions

You can run any of the following commands to set a cost for an imported route. The following commands are listed in the descending order of priority.
  • apply cost
  • import-route (OSPF)
  • default (OSPF)

Example

# Set the default values for the cost, type, and tag of imported routes.

<HUAWEI> system-view
[HUAWEI] ospf 100
[HUAWEI-ospf-100] default cost 10 tag 100 type 2
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >