Configuring an OSPF Stub Area

Configuring a non-backbone area as a stub area can reduce routing entries in the area in an AS does not transmit routes learned from other areas in the AS or AS external routes. This reduces bandwidth and storage resource consumption.

Applicable Environment

The number of LSAs can be reduced by partitioning an AS into different areas. To reduce the number of entries in the routing table and the number of LSAs to be transmitted in a non-backbone area, configure the non-backbone area on the border of the AS as a stub area.

Configuring a stub area is optional. A stub area generally resides on the border of an AS. For example, a non-backbone area with only one ABR can be configured as a stub area. In a stub area, the number of entries in the routing table and the amount of routing information to be transmitted greatly decrease.

Note the following points when configuring a stub area:

  • The backbone area (Area 0) cannot be configured as a stub area.
  • If an area needs to be configured as a stub area, all the routers in this area must be configured with stub attributes using the stub command.
  • An ASBR cannot exist in a stub area. External routes are not transmitted in the stub area.
  • Virtual links cannot exist in the stub area.

Pre-configuration Tasks

Before configuring a stub area, complete the following tasks:

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run ospf [ process-id ]

    The OSPF process view is displayed.

  3. Run area area-id

    The OSPF area view is displayed.

  4. Run stub

    The specified area is configured as a stub area.

    • All routers in a stub area must have the stub command configuration.
    • Running the stub command or canceling the configuration may cause the stub area to be updated. The stub command configuration on a device can be canceled or the configuration can be performed on new devices in the stub area only after the last area update is complete.

  5. (Optional) Run stub no-summary

    The ABR is prevented from sending Type 3 LSAs to the stub area.

  6. (Optional) Run stub default-route-advertise backbone-peer-ignore

    The ABR is prevented from checking the neighbor status when it generates a default Type 3 LSA and advertises it to the stub area.

  7. (Optional) Run default-cost cost

    A cost is set for the default route advertised to the stub area.

    To ensure the reachability of AS external routes, the ABR in the stub area generates a default route and advertises it to non-ABR routers in the stub area.

  8. Run commit

    The configuration is committed.

Verifying the Configuration

After configuring the stub area, verify the configuration.

  • Run the display ospf [ process-id ] lsdb command to check OSPF LSDB information.

  • Run the display ospf [ process-id ] peer command to check information about OSPF neighbors.

  • Run the display ospf [ process-id ] routing command to check information about the OSPF routing table.

When routers are in a common area, there are AS external routes in the routing table. After the area where the router resides is configured as a stub area, AS external routes no longer exist in the routing table, and the ASE field is displayed as 0 in the command output.

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