/
OSPF Area Type Configuration Example: NSSA, Stub and Standard Areas

OSPF Area Type Configuration Example: NSSA, Stub and Standard Areas

In OSPF terminology, a stub is an area in which external routes are not advertised. To reach external networks, a default summary route 0.0.0.0 is installed in the stub area to achieve connectivity with other areas. In the OSPF not-so-stubby-area (NSSA), the restriction on advertising external routes in the NSSA area is removed but in a limited fashion.

Configuration Example

Figure 5-4 depicts a sample OSPF topology with three different types of areas, the Standard, NSSA and the stub areas.

The configuration of OSPF NSSA and stub areas is shown in Fig. 5-4. Router 2 connects to the backbone area (area 0) through Router 4. This area between Switch 4 and Switch 3 is configured as the not-so-stubby-area (NSSA). Similarly, Router 1 connects with the backbone area through Router 2. Both Router 4 and Router 2 have one interface each in area 0.  Router 3 will receive routes for network 10.10.4.0/24, 10.10.3.0/24, 10.10.2.0/24 and 10.10.1.0/24. Similarly, Router 1 will receive routes from network 10.10.3.0/24, 10.10.4.0/24, 10.10.5.0/24 and 10.10.6.0/24.


                    Figure 5-4. OSPF NSSA and Stub area configurations. 



Configuring Router 1

On Router 1, we will configure one VLAN interface for network 10.10.2.1/24. Also we will configure OSPF area 0.0.0.2 and include network 10.10.2.1/24 in area 2.

admin@router1# set vlans vlan-id 10 l3-interface vlan10
admin@router1# set vlans vlan-id 20 l3-interface vlan20
admin@router1# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 10
admin@router1# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 20
admin@router1# set protocols ospf router-id 1.1.1.1
admin@router1# set protocols ospf network 10.10.2.0/24 area 0.0.0.2
admin@router1# set protocols ospf network 1.1.1.1/32 area 0.0.0.2
admin@router1# set protocols ospf area 2 area-type stub
admin@router1# set l3-interface loopback lo address 1.1.1.1 prefix-length 32
admin@router1# set l3-interface vlan-interface vlan10 address 10.10.2.1 prefix-length 24
admin@router1# set l3-interface vlan-interface vlan20 address 10.10.1.1 prefix-length 24
Commit OK.
Save done.
admin@router1# 

Configuring Router 2

Router 2 has to VLAN interfaces, one in area 0.0.0.2 and another in area 0.0.0.0. We will configure these interfaces for network 10.10.2.0/24 and 10.10.4.0/24 in the configuration shown below.

admin@router2# set vlans vlan-id 30 l3-interface "vlan30"
admin@router2# set vlans vlan-id 40 l3-interface "vlan40"
admin@router2# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 30
admin@router2# set interface gigabit-ethernet ge-1/1/5 family ethernet-switching native-vlan-id 40
admin@router2# set protocols ospf router-id 2.2.2.2
admin@router2# set protocols ospf network 10.10.2.0/24 area 0.0.0.2
admin@router2# set protocols ospf network 10.10.4.0/24 area 0.0.0.0
admin@router2# set protocols ospf area 0.0.0.2 area-type stub
admin@router2# set l3-interface loopback lo address 2.2.2.2 prefix-length 32
admin@router2# set l3-interface vlan-interface vlan30 address 10.10.2.2 prefix-length 24
admin@router2# set l3-interface vlan-interface vlan40 address 10.10.4.1 prefix-length 24
Commit OK.
Save done.
admin@XorPlus# 

Configuring Router 3

On Router 3 we will configure one OSPF interface in area 0.0.0.1.

admin@router3# set vlans vlan-id 50 l3-interface vlan50
admin@router3# set l3-interface vlan-interface vlan50 address 10.10.5.2 prefix-length 24
admin@router3# set interface gigabit-ethernet te-1/1/5 family ethernet-switching native-vlan-id 50
admin@router3# set interface gigabit-ethernet te-1/1/5 auto-speeds 1000
admin@router3# set protocols spanning-tree enable false
admin@router3# set protocols ospf router-id 3.3.3.3
admin@router3# set protocols ospf network 10.10.5.0/24 area 0.0.0.1
admin@router3# set protocols ospf area 0.0.0.1 area-type nssa
admin@router3# commit
Commit OK.
Save done.

Configuring Router 4

On Router 4 we will configure two network interfaces one each in area 0.0.0.0 and 0.0.0.1. Router 4 connects with Router 3 in area 0.0.0.1 and Router 2 in area 0.0.0.0.

admin@router4# set interface gigabit-ethernet te-1/1/1 family ethernet-switching native-vlan-id 40
admin@router4# set interface gigabit-ethernet te-1/1/2 family ethernet-switching native-vlan-id 50
admin@router4# set protocols ospf router-id 4.4.4.4
admin@router4# set protocols ospf network 10.10.4.0/24 area 0.0.0.0
admin@router4# set protocols ospf network 10.10.5.0/24 area 0.0.0.1
admin@router4# set protocols ospf area 0.0.0.1 area-type nssa
admin@router4# set protocols ospf network 4.4.4.4/32 area 0
admin@router4# set protocols ospf redistribute static
admin@router4# set l3-interface loopback lo address 4.4.4.4 prefix-length 32
admin@router4# set l3-interface vlan-interface vlan40 address 10.10.4.2 prefix-length 24
admin@router4# set l3-interface vlan-interface vlan50 address 10.10.5.1 prefix-length 24
admin@router4# set vlans vlan-id 40 l3-interface "vlan40"
admin@router4# set vlans vlan-id 50 l3-interface "vlan50"
Commit OK.
Save done.

Verify Routing Table

The routing table on Router 1 is displayed below.

admin@router1> show route ipv4
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

O   0.0.0.0/0 [110/11] via 10.10.2.2, vlan10, weight 1, 00:08:11
K>* 0.0.0.0/0 [0/0] via 10.10.51.1, eth0, 02:35:35
O   1.1.1.1/32 [110/0] is directly connected, lo, weight 1, 02:16:35
C>* 1.1.1.1/32 is directly connected, lo, 02:16:35
O>* 4.4.4.4/32 [110/20] via 10.10.2.2, vlan10, weight 1, 00:06:55
O   10.10.2.0/24 [110/10] is directly connected, vlan10, weight 1, 00:46:21
C>* 10.10.2.0/24 is directly connected, vlan10, 00:47:01
O>* 10.10.4.0/24 [110/20] via 10.10.2.2, vlan10, weight 1, 00:07:05
O>* 10.10.5.0/24 [110/30] via 10.10.2.2, vlan10, weight 1, 00:02:25

The routing table on Router 3 is displayed below.

admin@router3> show route ipv4
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

O   0.0.0.0/0 [110/11] via 10.10.5.1, vlan50, weight 1, 00:16:09
O>* 1.1.1.1/32 [110/30] via 10.10.5.1, vlan50, weight 1, 00:16:09
O>* 4.4.4.4/32 [110/10] via 10.10.5.1, vlan50, weight 1, 00:16:09
O>* 10.10.2.0/24 [110/30] via 10.10.5.1, vlan50, weight 1, 00:16:09
O>* 10.10.4.0/24 [110/20] via 10.10.5.1, vlan50, weight 1, 00:16:09
O   10.10.5.0/24 [110/10] is directly connected, vlan50, weight 1, 00:21:59
C>* 10.10.5.0/24 is directly connected, vlan50, 00:21:59

Copyright © 2025 Pica8 Inc. All Rights Reserved.