The default-route-advertise command advertises default routes in a common OSPF area.
The undo default-route-advertise command disables advertisement of default routes in a common OSPF area.
By default, OSPF devices in a common OSPF area do not advertise default routes.
default-route-advertise [ [ always | permit-calculate-other ] | cost cost | type type | route-policy route-policy-name [ match-any ] ] *
default-route-advertise summary cost cost
undo default-route-advertise
| Parameter | Description | Value |
|---|---|---|
always |
Enables the device to generate and advertise an LSA that describes a default route, regardless of whether the local device has active default routes learned from a non-local OSPF process. |
- |
permit-calculate-other |
Enables the device to generate and advertise an ASE LSA that describes a default route only when the local device has active default routes learned from a non-local OSPF process. In this case, the device still calculates default routes from other devices. NOTE:
If neither always nor permit-calculate-other is configured,
|
- |
cost cost |
Specifies the cost of the external routes.
|
The value is an integer ranging from 0 to 16777214. The default value 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. |
route-policy route-policy-name |
Specifies the name of a routing policy, according to whose parameters the device advertises default routes when there are matched default OSPF routes generated by a non-local OSPF process. |
The value must be the name of an existing routing policy. |
summary |
Advertises the Type-3 summary LSA of the specified default route. Before specifying this parameter, ensure that VPN is enabled. Otherwise, routes cannot be advertised. |
- |
match-any |
Indicates that a device matches the routing entry in the routing table by using a routing policy and then advertises the default route based on the parameters set through the routing policy. |
- |
Usage Scenario
The import-route (OSPF) command cannot be used to import a default route from another AS. To advertise a non-OSPF default route in a common OSPF area, run the default-route-advertise command on an ASBR.
If the ASBR has a default route, the default-route-advertise command enables the ASBR to advertise the default route 0.0.0.0 to the OSPF area.
If the ASBR has no default route, the default-route-advertise always command or the default-route-advertise command can be used:
With always configured: The ASBR can advertise the default route 0.0.0.0 even if there is no default route. This allows the default route to retain in the routing table and prevents the ASBR from using a default route sent by another device.
Without always configured: The ASBR generates an LSA that describes a default route only when the local routing table contains an active default route learned from a non-local OSPF (excluding BGP) process.
Injecting an IBGP route into the OSPF routing table may cause a routing loop. Exercise caution when you perform this step.
Prerequisites
Before advertising a default route, OSPF compares the priorities of default routes in an OSPF area and then advertises a default route with the highest priority. If a static default route is configured on an OSPF device, check that the priority of the static default route is lower than that of the default route to be advertised by OSPF. This ensures that the default route advertised by OSPF will be added to the routing table of the OSPF device.
Configuration Impact
After the default-route-advertise command is configured on the ASBR, the ASBR will generate a Type-5 ASE LSA with a link state ID of 0.0.0.0 and mask of 0.0.0.0. In addition, it will advertise the ASE LSA in an entire OSPF area.
If a routing policy is configured, default routes are advertised based on the following principles:
Precautions
In different OSPF areas, OSPF advertises default routes using different modes. This default-route-advertise command can be used to advertise default routes in a common OSPF area. In the STUB, Totally STUB, or Totally NSSA area, default routes are advertised automatically. In an NSSA area, the nssa default-route-advertise command is used to advertise default routes.
Creating a route-policy before it is referenced is recommended. By default, nonexistent route-policies cannot be referenced using the command. If the route-policy nonexistent-config-check disable command is run in the system view and a nonexistent route-policy is referenced using the current command, the device advertises the default route as long as a default route that is not generated by the current IS-IS process exists in the local routing table.