< Home

default-route-advertise (OSPFv3)

Function

The default-route-advertise command advertises default routes into an OSPFv3 routing domain.

The undo default-route-advertise command cancels advertising default routes.

Format

default-route-advertise [ always | cost cost | type type | tag tag | route-policy route-policy-name [ match-any ] ]*

undo default-route-advertise [ always | cost [ cost ] | type [ type ] | tag [ tag ] | route-policy [ route-policy-name ] [ match-any ] ]*

Parameters

Parameter Description Value

always

Generates and advertises an LSA that describes a default route, regardless of whether the local device has active default routes from processes other than the local OSPFv3 process. The switch that has always configured does not calculate default routes of other switches. If always is not specified, an LSA is generated only when there are active non-OSPFv3 default routes in the routing table of the local device.

-

cost cost

Specifies the cost of an advertised default route.

The value is an integer that ranges from 1 to 16777214. The default value is 1.

type type

Specifies the type of an external route.

The value is 1 or 2. The default value is 2.
  • 1: Type 1 external route
  • 2: Type 2 external route

tag tag

Specifies the tag value of an advertised default route.

The value is an integer that ranges from 0 to 4294967295. The default value is 1.

route-policy route-policy-name

Specifies the name of a route-policy. The device advertises default routes according to the parameters configured in the route-policy when there are matched non-OSPFv3 default routes in the routing table.

The name is a string of 1 to 40 case-sensitive characters, with spaces not supported. When double quotation marks are used around the string, spaces are allowed in the string.

match-any

Indicates that through a route-policy, the device advertises default routes according to the parameters configured in the route-policy when there are matched routes in the routing table.

-

Views

OSPFv3 view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

If a static default route has been configured on an OSPF-capable switch, OSPF compares the preferences of default routes before advertising a default route. To add the default route advertised by OSPF to the current routing table, ensure that the preference of the static default route is lower than that of the default route advertised by OSPF.

Default routes that are imported using the import-route command cannot be advertised. To advertise default routes, run the default-route-advertise command. The cost of a generated default route is determined by the cost and type parameters in the default-route-advertise command, and the default tag value is 1. If the local routing table does not contain non-OSPFv3 default routes, specify the always parameter to generate an ASE LSA of a default route.

A route-policy is only used to filter existing active non-OSPFv3 default routes of the local device, and match routes according to the following rules:

  • If a default route matches the policy, the local device generates a default route according to the parameters configured in the route-policy, such as the cost, tag, and type.

  • If a default route does not match the policy and always is not specified, the local device does not generate any default route.

  • If a default route does not match the policy and always is specified, the switch generates a default route. The parameters of the generated default route are determined by the default-route-advertise [ always | cost cost | type type | tag tag | route-policy route-policy-name ]* command.

The preferences of parameters of the default route configured in a route-policy are higher than those of parameters configured in the default-route-advertise [ always | cost cost | type type | tag tag | route-policy route-policy-name ] * command.

Precautions

Creating a route-policy before it is referenced is recommended. If a nonexistent route-policy is referenced using the command, the device advertises the default IPv6 route as long as a default IPv6 route that is not generated by the current OSPFv3 process exists in the local routing table.

Example

# Advertise the ASE LSA that describes a default route into an OSPFv3 routing domain. The local device does not have a default route.

<HUAWEI> system-view
[HUAWEI] ospfv3 1
[HUAWEI-ospfv3-1] default-route-advertise always
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >