< Home

Configuring OSPF to Advertise Default Routes to an OSPF Area

Context

On an OSPF network, multiple switches often reside on the area border and AS border for next-hop backup or traffic load balancing. To reduce routing entries and improve resource usage on the OSPF network, you can configure a default route in the following scenarios:

  1. An ABR advertises a Type 3 LSA carrying a default route for instructing switches to forward inter-area packets.
  2. An ASBR advertises a Type 5 or Type 7 LSA carrying a default route for instructing switches to forward AS external packets.

When no matching route is discovered, the switch can forward packets through a default route.

The preference of a default route in Type 3 LSAs is higher than that of the route in Type 5 or Type 7 LSAs.

Advertisement of a default route is determined by the type of the area to which the default route needs to be imported. Table 1 lists the default route advertisement by area type.

Table 1 Default route advertising mode

Area Type

Generated By

Advertised By

LSA Type

Flooding Area

Common area

A default route is generated using the default-route-advertise command.

ASBR

Type 5 LSA

Common area

Stub area

A default route is generated automatically.

ABR

Type 3 LSA

Stub area

NSSA

A default route is generated using the nssa [ default-route-advertise ] command.

ASBR

Type 7 LSA

NSSA

Totally NSSA

A default route is generated automatically.

ABR

Type 3 LSA

NSSA

Perform the following steps on an ASBR running OSPF.

Procedure

  • Configure OSPF to advertise a default route to an OSPF area.
    1. Run system-view

      The system view is displayed.

    2. Run ospf [ process-id ]

      The OSPF process view is displayed.

    3. Run default-route-advertise [ [ always | permit-calculate-other ] | cost cost | type type | route-policy route-policy-name [ match-any ] ] *

      OSPF is configured to advertise a default route to the OSPF area.

      • The parameter always indicates that an LSA describing a default route is generated and then advertised regardless of whether there are active default routes of other OSPF processes in the routing table of the local device.
      • The parameter permit-calculate-other indicates that the local router is allowed to calculate the default routes advertised by other switches after adverting its own default route.
      • The parameter route-policy route-policy-name indicates that the local device advertises default routes according to the parameters of the configured routing policy when there are matched default routing entries generated by other OSPF processes.
      • An ASE LSA describing a default route is generated and then advertised only when there is an active default route of another OSPF process in the routing table of the local device.
      • Before advertising default routes, OSPF compares the preferences of default routes. Therefore, if a static default route is configured on an OSPF switch, the default route advertised by OSPF can be added to the current routing table only when it has a higher preference than the static route.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >