The default command configures default parameters for OSPF to import external routes. The parameters include the cost, type (Type 1 or Type 2), and tag.
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.
Parameter | Description | Value |
---|---|---|
cost costvalue |
Specifies the default cost of the external routes imported by OSPF. |
The value is an integer ranging from 0 to 16777214. The default value is 1. |
inherit-metric |
Indicates that the cost of the imported route is the one carried in the route. If no cost is specified, the default cost set using the default command is used. |
- |
tag tagvalue |
Specifies the tag of the external routes. |
The value is an integer ranging from 0 to 4294967295. The default value is 1. |
type typevalue |
Specifies the type of the external routes. |
The value is 1 or 2.
The default value is 2. |
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 to import external routes, you can control OSPF route selection. 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. In addition, configuring tag can filter OSPF routes carrying tags.Follow-up Procedure
The default (OSPF) command has the lowest priority. Therefore, you need to check whether other commands are configured before running this command. Otherwise, the function of this command does not take effect.
Precautions
You can run the following commands to set the cost of imported routes. The following commands are listed in descending order of cost priorities.