Friday , April 26 2024
Home / IP Routing / OSPF stub area on Huawei router

OSPF stub area on Huawei router

Instead of transmitting learned AS external routes, area border router, in a stub area, generates a default route and advertises the route to non-ABRs in the stub area. In short, stub area reduces entries in the routing table of ABR and the amount of routing information to be transmitted.

We have to remember that:

  • The backbone area cannot be a stub area
  • All routers in a stub area need to be configured using stub attributes
  • The ASBR cannot exist in a stub area
  • Virtual links cannot be configured in stub area.

Let’s try to configure a simple lab. We would like to see what happens if AREA1 becomes a stub area.

  1. Based on the topology, configure IP address of each interface.
  2. Enable OSPF on each router and configure basic OSPF functions
  3. Configure AREA1 as stub and and check routing information on router Gdansk.
  4. Check routing information on router Gdansk, previously stopping advertising type 3 LSA into the stub area.
OSPF basic configuration:
[Krakow]dis c c ospf
ospf 1 
 area 0.0.0.0 
  network 1.1.1.1 0.0.0.0 
  network 10.1.1.0 0.0.0.255 

[Warsaw]dis c c ospf
ospf 1 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 10.1.1.0 0.0.0.255 
 area 0.0.0.1 
  network 172.16.1.0 0.0.0.255 

[Gdansk]dis c c ospf
ospf 1 
 area 0.0.0.1 
  network 3.3.3.3 0.0.0.0 
  network 172.16.1.0 0.0.0.255

Configure router Krakow to import direct and static routes:

[Krakow]interface LoopBack 100
[Krakow-LoopBack100]ip address 5.5.5.5 255.255.255.255

[Krakow]int LoopBack 200
[Krakow-LoopBack200]ip address 6.6.6.6 255.255.255.255

[Krakow]ip route-static 100.100.100.0 255.255.255.0 NULL0
[Krakow]ip route-static 200.200.200.0 255.255.255.0 NULL0

[Krakow]ospf
[Krakow-ospf-1]import-route direct 
[Krakow-ospf-1]import-route static

Check routing table of router Gdansk:

[Gdansk]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 15       Routes : 15       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.1/32  OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
        2.2.2.2/32  OSPF    10   1           D   172.16.1.1      GigabitEthernet0/0/1
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
        5.5.5.5/32  O_ASE   150  1           D   172.16.1.1      GigabitEthernet0/0/1
        6.6.6.6/32  O_ASE   150  1           D   172.16.1.1      GigabitEthernet0/0/1
       10.1.1.0/24  OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
  100.100.100.0/24  O_ASE   150  1           D   172.16.1.1      GigabitEthernet0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.1.0/24  Direct  0    0           D   172.16.1.2      GigabitEthernet0/0/1
     172.16.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
   172.16.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
  200.200.200.0/24  O_ASE   150  1           D   172.16.1.1      GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[Gdansk]dis ospf routing 

	 OSPF Process 1 with Router ID 3.3.3.3
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 3.3.3.3/32         0     Stub       3.3.3.3         3.3.3.3         0.0.0.1
 172.16.1.0/24      1     Transit    172.16.1.2      3.3.3.3         0.0.0.1
 1.1.1.1/32         2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1
 2.2.2.2/32         1     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1
 10.1.1.0/24        2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1

 Routing for ASEs
 Destination        Cost      Type       Tag         NextHop         AdvRouter
 5.5.5.5/32         1         Type2      1           172.16.1.1      1.1.1.1
 6.6.6.6/32         1         Type2      1           172.16.1.1      1.1.1.1
 100.100.100.0/24   1         Type2      1           172.16.1.1      1.1.1.1
 200.200.200.0/24   1         Type2      1           172.16.1.1      1.1.1.1

 Total Nets: 9  
 Intra Area: 2  Inter Area: 3  ASE: 4  NSSA: 0 

[Gdansk]dis ospf lsdb 

	 OSPF Process 1 with Router ID 3.3.3.3
		 Link State Database 

		         Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    2.2.2.2         2.2.2.2             69  36    80000006       1
 Router    3.3.3.3         3.3.3.3             67  48    80000007       0
 Network   172.16.1.2      3.3.3.3             67  32    80000003       0
 Sum-Net   2.2.2.2         2.2.2.2            114  28    80000003       0
 Sum-Net   10.1.1.0        2.2.2.2            114  28    80000003       1
 Sum-Net   1.1.1.1         2.2.2.2            114  28    80000003       1
 Sum-Asbr  1.1.1.1         2.2.2.2            114  28    80000003       1

		 AS External Database
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 External  6.6.6.6         1.1.1.1             38  36    80000004       1
 External  5.5.5.5         1.1.1.1             38  36    80000004       1
 External  100.100.100.0   1.1.1.1           1789  36    80000003       1
 External  10.1.1.0        1.1.1.1             38  36    80000004       1
 External  1.1.1.1         1.1.1.1             38  36    80000004       1
 External  200.200.200.0   1.1.1.1           1789  36    80000003       1

Now configure AREA1 as a stub area:

[Warsaw]ospf	
[Warsaw-ospf-1]area 1	
[Warsaw-ospf-1-area-0.0.0.1]stub 

[Gdansk]ospf
[Gdansk-ospf-1]are 1
[Gdansk-ospf-1-area-0.0.0.1]stub

Check routing table of router Gdansk again:

[Gdansk]dis ip rout
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
        1.1.1.1/32  OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
        2.2.2.2/32  OSPF    10   1           D   172.16.1.1      GigabitEthernet0/0/1
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
       10.1.1.0/24  OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.1.0/24  Direct  0    0           D   172.16.1.2      GigabitEthernet0/0/1
     172.16.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
   172.16.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[Gdansk]dis ospf routing 

	 OSPF Process 1 with Router ID 3.3.3.3
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 3.3.3.3/32         0     Stub       3.3.3.3         3.3.3.3         0.0.0.1
 172.16.1.0/24      1     Transit    172.16.1.2      3.3.3.3         0.0.0.1
 0.0.0.0/0          2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1
 1.1.1.1/32         2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1
 2.2.2.2/32         1     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1
 10.1.1.0/24        2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1

 Total Nets: 6  
 Intra Area: 2  Inter Area: 4  ASE: 0  NSSA: 0 

[Gdansk]dis ospf lsdb 

	 OSPF Process 1 with Router ID 3.3.3.3
		 Link State Database 

		         Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    2.2.2.2         2.2.2.2             88  36    80000005       1
 Router    3.3.3.3         3.3.3.3             81  48    80000005       0
 Network   172.16.1.2      3.3.3.3             81  32    80000002       0
 Sum-Net   0.0.0.0         2.2.2.2            156  28    80000001       1
 Sum-Net   2.2.2.2         2.2.2.2            156  28    80000001       0
 Sum-Net   10.1.1.0        2.2.2.2            156  28    80000001       1
 Sum-Net   1.1.1.1         2.2.2.2            156  28    80000001       1

As you can see, in the stub area, AS external routes are invisible. Instead, there is a default route.

Let’s stop advertisement of type 3 LSAs into the stub area, on ABR (router Warsaw):

[Warsaw]ospf
[Warsaw-ospf-1]area 1
[Warsaw-ospf-1-area-0.0.0.1]stub no-summary

And check routing table of router Gdansk once again:

[Gdansk]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 9        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   OSPF    10   2           D   172.16.1.1      GigabitEthernet0/0/1
        3.3.3.3/32  Direct  0    0           D   127.0.0.1       LoopBack0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
     172.16.1.0/24  Direct  0    0           D   172.16.1.2      GigabitEthernet0/0/1
     172.16.1.2/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
   172.16.1.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet0/0/1
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

[Gdansk]dis ospf rout

	 OSPF Process 1 with Router ID 3.3.3.3
		  Routing Tables 

 Routing for Network 
 Destination        Cost  Type       NextHop         AdvRouter       Area
 3.3.3.3/32         0     Stub       3.3.3.3         3.3.3.3         0.0.0.1
 172.16.1.0/24      1     Transit    172.16.1.2      3.3.3.3         0.0.0.1
 0.0.0.0/0          2     Inter-area 172.16.1.1      2.2.2.2         0.0.0.1

 Total Nets: 3  
 Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0 

[Gdansk]dis ospf lsdb

	 OSPF Process 1 with Router ID 3.3.3.3
		 Link State Database 

		         Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    2.2.2.2         2.2.2.2            114  36    80000006       1
 Router    3.3.3.3         3.3.3.3            106  48    8000000A       0
 Network   172.16.1.2      3.3.3.3            106  32    80000002       0
 Sum-Net   0.0.0.0         2.2.2.2            572  28    80000001       1

The routing entries of the stub router are further reduced and only the default route, to a destination outside the AS, is reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *