< Home

default

Function

The default command configures the default parameters for importing external routes. The default parameters include the cost, type, tag, and number of imported routes.

The undo default command restores the default setting.

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

Format

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

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

Parameters

Parameter Description Value
cost cost

Specifies the default cost of the imported route.

The value is an integer ranging from 0 to 16777214.

inherit-metric

Indicates that the cost of the imported route is the cost carried in the route.

If no cost is specified, you can use the default command to set the default cost.

-

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 route.

The value is an integer ranging from 0 to 4294967295. By default, it is 1.

type type

Specifies the type of the external route.

The value is an integer ranging from 1 to 2.

  • 1: Type 1 external route
  • 2: Type 2 external route

By default, it is 2.

Views

OSPF view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

Imported external routes carry parameters, which affect the priority and next hops of these routes in the OSPF routing table. By configuring default parameters for imported external routes, you can change OSPF routing.

A route tag is used to identify protocol-related information. For example, it can be used to differentiate AS numbers carried in BGP routes imported by OSPF. You can also apply the route-policy to the routes with tags.

Precautions

You can run one of the following commands to set the cost of the imported route. The following commands are listed in descending priority order.

  • Run the apply cost command to set the cost of a route.
  • Run the import-route (OSPF) command to set the cost of the imported route.
  • Run the default command to set the default cost of the imported route.

The default command has the lowest priority among the preceding commands. Therefore, ensure that the other two commands are not configured. Otherwise, this command will not take effect.

The cost configured using the default command does not take effect on the BGP routes imported by PEs.

Example

# Set the default values of the cost, type, tag, and upper limit of routes.

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