How Does OSPF Inject a Default Route into a Stub or Totally Stub Area (V200)
How Does OSPF Inject a Default Route into a Stub or Totally Stub Area
Understanding Stub Area and Totally Stub Area
This document describes OSPF stub area and totally stub area, and provides an example to describe how to reduce the routing table size and the number of routes to be transmitted by injecting default routes without affecting communication.
Understanding Stub Area and Totally Stub Area
A stub area is a special area in which an ABR does not flood received AS external routes. In a stub area, routers maintain fewer routing entries and transmit less routing information.
Configuring a stub area is optional and not every area can be configured as such. A stub area is usually a non-backbone area containing only one ABR and resides on the border of an AS. To ensure the reachability of AS external routes, the ABR will generate a default route and advertise the route to non-ABRs in the stub area.
A totally stub area further limits the propagation of inter-area routes in this area because only one egress is available to transmit the data packets of the routers in the area. A totally stub area allows only intra-area routes and ABR-advertised Type 3 LSAs that carry a default route to be advertised within the area, excluding AS external routes and inter-area routes.
Networking Requirements
In Figure 1-1, OSPF runs among the three switches. The entire OSPF network is divided into Area0 and Area1. SwitchB functions as an ASBR to communicate with external networks. The size of the OSPF routing table on SwitchC needs to be reduced without affecting communication.
Configuration Roadmap
- Configure basic OSPF functions on each switch for communication on the OSPF network.
- Configure static routes to external networks on SwitchB and import the routes into the OSPF routing table so that there are reachable routes between the OSPF network and external networks.
- Configure Area1 as a stub area to reduce the size of the OSPF routing table on SwitchC.
- Disable the ABR (SwitchA) in Area1 from advertising Type 3 LSAs to Area1 to minimize the size of the OSPF routing table on SwitchC. This operation will configure Area 1 as a totally stub area.
Procedure
- Specify the VLANs to which interfaces belong.
# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the configuration of SwitchA, and are not mentioned here.
<HUAWEI> system-view [HUAWEI] sysname SwitchA [SwitchA] vlan batch 10 20 [SwitchA] interface gigabitethernet 1/0/1 [SwitchA-GigabitEthernet1/0/1] port link-type trunk [SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 10 [SwitchA-GigabitEthernet1/0/1] quit [SwitchA] interface gigabitethernet 1/0/2 [SwitchA-GigabitEthernet1/0/2] port link-type trunk [SwitchA-GigabitEthernet1/0/2] port trunk allow-pass vlan 20 [SwitchA-GigabitEthernet1/0/2] quit
- Configure IP addresses for VLANIF interfaces.
# Configure SwitchA. The configurations of SwitchB and SwitchC are similar to the configuration of SwitchA, and are not mentioned here.
[SwitchA] interface vlanif 10 [SwitchA-Vlanif10] ip address 192.168.0.1 24 [SwitchA-Vlanif10] quit [SwitchA] interface vlanif 20 [SwitchA-Vlanif20] ip address 192.168.1.1 24 [SwitchA-Vlanif20] quit
- Configure basic OSPF functions.
# Configure SwitchA.
[SwitchA] ospf 1 router-id 10.1.1.1 [SwitchA-ospf-1] area 0 [SwitchA-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [SwitchA-ospf-1-area-0.0.0.0] quit [SwitchA-ospf-1] area 1 [SwitchA-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255 [SwitchA-ospf-1-area-0.0.0.1] quit [SwitchA-ospf-1] quit
Configure SwitchB.
[SwitchB] ospf 1 router-id 10.2.2.2 [SwitchB-ospf-1] area 0 [SwitchB-ospf-1-area-0.0.0.0] network 192.168.0.0 0.0.0.255 [SwitchB-ospf-1-area-0.0.0.0] quit [SwitchB-ospf-1] quit
# Configure SwitchC.
[SwitchC] ospf 1 router-id 10.3.3.3 [SwitchC-ospf-1] area 1 [SwitchC-ospf-1-area-0.0.0.1] network 192.168.1.0 0.0.0.255 [SwitchC-ospf-1-area-0.0.0.1] quit [SwitchC-ospf-1] quit
- Configure SwitchB to import static routes.
[SwitchB] ip route-static 10.0.0.0 8 null 0 [SwitchB] ospf 1 [SwitchB-ospf-1] import-route static type 1 [SwitchB-ospf-1] quit
# Check the OSPF routing table on SwitchC. The following command output shows that the OSPF routing table contains an AS external route.
[SwitchC] display ospf routing OSPF Process 1 with Router ID 10.3.3.3 Routing Tables Routing for Network Destination Cost Type NextHop AdvRouter Area 192.168.1.0/24 1 Transit 192.168.1.2 10.3.3.3 0.0.0.1 192.168.0.0/24 2 Inter-area 192.168.1.1 10.1.1.1 0.0.0.1 Routing for ASEs Destination Cost Type Tag NextHop AdvRouter 10.0.0.0/8 3 Type1 1 192.168.1.1 10.2.2.2 Total Nets: 3 Intra Area: 1 Inter Area: 1 ASE: 1 NSSA: 0
- Configure Area1 as a stub area.
# Configure SwitchA.
[SwitchA] ospf 1 [SwitchA-ospf-1] area 1 [SwitchA-ospf-1-area-0.0.0.1] stub [SwitchA-ospf-1-area-0.0.0.1] quit [SwitchA-ospf-1] quit
# Configure SwitchC.
[SwitchC] ospf 1 [SwitchC-ospf-1] area 1 [SwitchC-ospf-1-area-0.0.0.1] stub [SwitchC-ospf-1-area-0.0.0.1] quit [SwitchC-ospf-1] quit
# Check the OSPF routing table on SwitchC. The following command output shows that the AS external route disappears, and there is a default route to external networks.
[SwitchC] display ospf routing OSPF Process 1 with Router ID 10.3.3.3 Routing Tables Routing for Network Destination Cost Type NextHop AdvRouter Area 192.168.1.0/24 1 Transit 192.168.1.2 10.3.3.3 0.0.0.1 0.0.0.0/0 2 Inter-area 192.168.1.1 10.1.1.1 0.0.0.1 192.168.0.0/24 2 Inter-area 192.168.1.1 10.1.1.1 0.0.0.1 Total Nets: 3 Intra Area: 1 Inter Area: 2 ASE: 0 NSSA: 0
- Configure Area1 as a totally stub area.
[SwitchA] ospf 1 [SwitchA-ospf-1] area 1 [SwitchA-ospf-1-area-0.0.0.1] stub no-summary [SwitchA-ospf-1-area-0.0.0.1] quit [SwitchA-ospf-1] quit
- Verify the configuration.
# Check the OSPF routing table on SwitchC. The following command output shows that the route destined for 192.168.0.0/24 disappears, and there are only an intra-area OSPF route and the default route to external networks.
[SwitchC] display ospf routing OSPF Process 1 with Router ID 10.3.3.3 Routing Tables Routing for Network Destination Cost Type NextHop AdvRouter Area 192.168.1.0/24 1 Transit 192.168.1.2 10.3.3.3 0.0.0.1 0.0.0.0/0 2 Inter-area 192.168.1.1 10.1.1.1 0.0.0.1 Total Nets: 2 Intra Area: 1 Inter Area: 1 ASE: 0 NSSA: 0
Related Information
For more information and configuration of OSPF stub and totally stub areas, see the following product document:
S2720, S5700, S6720 V200R013C00 Configuration Guide - IP Unicast Routing - OSPF Configuration