Multi-Area OSPF with Stub Areas

Posted: January 29, 2016 in CISCO

In this example i used c3745-advipservicesk9-mz.124-25d.bin,you can download it from here

Untitled.png

 

R1:

!

interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Serial1/0
ip address 10.1.12.1 255.255.255.0
!
router ospf 1
network 10.1.0.0 0.0.255.255 area 0

 

R2:

!
interface Loopback0
ip address 10.1.2.1 255.255.255.0
ip ospf 2 area 0
!
interface Serial1/0
ip address 10.1.12.2 255.255.255.0
ip ospf 2 area 0
!
interface Serial1/1
ip address 10.1.23.2 255.255.255.0
ip ospf 2 area 23

R3

!
interface Loopback0
ip address 10.1.3.1 255.255.255.0
!
interface Loopback1
ip address 172.20.200.1 255.255.255.0
!
interface Serial1/1
ip address 10.1.23.3 255.255.255.0
!
router ospf 3
network 10.1.23.0 0.0.0.255 area 23
network 172.20.200.0 0.0.0.255 area 23

 

Configuring stub area for area 23

Stub areas are used to control injecting external routes (which go through ABR router) into area.In this example R2 is area border router (ABR) because it connects areas O and 23.Stub areas are connected by area <area number> stub command.This command must be executed on ABR and router in related area,otherwise OSPF relationship breaks down.

R2(config)router ospf 2
R2(config-router)#area 23 stub

R2(config)router ospf 3
R3(config-router)#area 23 stub

Area 23 is now stub area which means that this area no longer receives any external route.It receives a default route and OSPF inter area routes

R3(config-router)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override

Gateway of last resort is 10.1.23.2 to network 0.0.0.0

O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:00:02, Serial1/0
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O IA 10.1.1.1/32 [110/129] via 10.1.23.2, 00:00:02, Serial1/0
O IA 10.1.2.0/24 [110/65] via 10.1.23.2, 00:00:02, Serial1/0
C 10.1.3.0/24 is directly connected, Loopback0
L 10.1.3.1/32 is directly connected, Loopback0
O IA 10.1.12.0/24 [110/128] via 10.1.23.2, 00:00:02, Serial1/0
C 10.1.23.0/24 is directly connected, Serial1/0
L 10.1.23.3/32 is directly connected, Serial1/0
172.20.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.20.200.0/24 is directly connected, Loopback1

Default route is set to R2’s s1/0 interface (10.1.23.2)

The benefit is that router memory is conserved because router has less routes to handle with.

Totally stubby area alows only a single summary route from backbone area (Area 0).To configure it,command area <area number> no-summary needs to be executed on ABR (R2 in this case)

OSPF database before configuring totally stuby area:

R2(config-router)#do sh ip ospf dat

OSPF Router with ID (10.1.2.1) (Process ID 2)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
10.1.1.1 10.1.1.1 319 0x80000003 0x0062CA 3
10.1.2.1 10.1.2.1 313 0x80000008 0x004DD7 3

Summary Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.1.3.1 10.1.2.1 101 0x80000001 0x00E5F8
10.1.23.0 10.1.2.1 938 0x80000001 0x0009C3
172.20.200.1 10.1.2.1 101 0x80000001 0x003F24

Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 106 0x80000006 0x00258E 2
172.20.200.1 172.20.200.1 106 0x80000004 0x007607 4

Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 180 0x80000001 0x003BF4
10.1.1.1 10.1.2.1 180 0x80000002 0x0018C9
10.1.2.0 10.1.2.1 180 0x80000002 0x00948D
10.1.12.0 10.1.2.1 180 0x80000002 0x009E3A


R3(config-router)#do sh ip ospf dat

OSPF Router with ID (172.20.200.1) (Process ID 2)

Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 168 0x80000006 0x00258E 2
172.20.200.1 172.20.200.1 167 0x80000004 0x007607 4

Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 241 0x80000001 0x003BF4
10.1.1.1 10.1.2.1 241 0x80000002 0x0018C9
10.1.2.0 10.1.2.1 241 0x80000002 0x00948D
10.1.12.0 10.1.2.1 241 0x80000002 0x009E3A

 

R2(config)router ospf 2
R2(config-router)#area 23 stub no summary

We can see now that R2 and R3 has only one,default,summary route.

R2(config)router ospf 2
R2(config-router)#do sh ip ospf dat

OSPF Router with ID (10.1.2.1) (Process ID 2)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
10.1.1.1 10.1.1.1 542 0x80000003 0x0062CA 3
10.1.2.1 10.1.2.1 536 0x80000008 0x004DD7 3

Summary Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.1.3.1 10.1.2.1 324 0x80000001 0x00E5F8
10.1.23.0 10.1.2.1 1162 0x80000001 0x0009C3
172.20.200.1 10.1.2.1 324 0x80000001 0x003F24

Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 329 0x80000006 0x00258E 2
172.20.200.1 172.20.200.1 330 0x80000004 0x007607 4

Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 22 0x80000003 0x0037F6

R3#sh ip ospf dat

OSPF Router with ID (172.20.200.1) (Process ID 2)

Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 341 0x80000006 0x00258E 2
172.20.200.1 172.20.200.1 340 0x80000004 0x007607 4

Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 34 0x80000003 0x0037F6

 

R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.1.23.2 to network 0.0.0.0

172.20.0.0/24 is subnetted, 1 subnets
C 172.20.200.0 is directly connected, Loopback1
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.3.0 is directly connected, Loopback0
C 10.1.23.0 is directly connected, Serial1/1
O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:35:28, Serial1/1

Routers in the area see default and intra-area routers (routes between areas),this saves router processor times and memory,but drawback is that not optimal routes can be chosen.ARB router is the gateway to the rest of area and is boundary through all LSA’s needs to pass.

Not so stubby area allow routes to be redistributed from ASBR routers into that area which are special LSA types (Type 7),converted to LSA type 5 (known as autonomous system external LSA: The external LSAs are generated by the ASBR) by ABR (R2).To generate an external route into into NSSA,we need to use redistribute connected subnets on R3 router,subnets keyword is used to redistribute classless networks

 

R2(config)router ospf 2 
R2(config-router)#area 23 nssa

R3(config)router ospf 3 
R3(config-router)#area 23 nssa 
R3(config-router)#redistribute connected subnets


R2#sh ip ospf dat

OSPF Router with ID (10.1.2.1) (Process ID 2)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count
10.1.1.1 10.1.1.1 123 0x80000005 0x005ECC 3
10.1.2.1 10.1.2.1 263 0x80000006 0x0061C2 3

Summary Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum
10.1.23.0 10.1.2.1 263 0x80000003 0x0005C5
172.20.200.1 10.1.2.1 1818 0x80000002 0x003D25

Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 1818 0x80000006 0x00B2F6 2
172.20.200.1 172.20.200.1 1955 0x80000008 0x004649 3

Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 1567 0x80000002 0x00C066

Type-7 AS External Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Tag
10.1.3.0 172.20.200.1 1956 0x80000002 0x00086A 0

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
10.1.3.0 10.1.2.1 1821 0x80000002 0x005C9C 0

R3#sh ip ospf dat

 OSPF Router with ID (172.20.200.1) (Process ID 3)

 Router Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Link count
10.1.2.1 10.1.2.1 1905 0x80000006 0x00B2F6 2
172.20.200.1 172.20.200.1 48 0x80000009 0x00444A 3

 Summary Net Link States (Area 23)

Link ID ADV Router Age Seq# Checksum
0.0.0.0 10.1.2.1 1654 0x80000002 0x00C066

 Type-7 AS External Link States (Area 23)

Link ID ADV Router Age Seq# Checksum Tag
10.1.3.0 172.20.200.1 48 0x80000003 0x00066B 0

We can see external route,injected in R2 as N2 from R3:

R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

172.20.0.0/32 is subnetted, 1 subnets
O 172.20.200.1 [110/65] via 10.1.23.3, 00:02:23, Serial1/1
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.1.12.0/24 is directly connected, Serial1/0
O N2 10.1.3.0/24 [110/20] via 10.1.23.3, 00:02:23, Serial1/1
C 10.1.2.0/24 is directly connected, Loopback0
O 10.1.1.1/32 [110/65] via 10.1.12.1, 00:03:07, Serial1/0
C 10.1.23.0/24 is directly connected, Serial1/1

Look at routing table on R1:

R1(config-router)#do sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

172.20.0.0/32 is subnetted, 1 subnets
O IA 172.20.200.1 [110/129] via 10.1.12.2, 00:03:12, Serial1/0
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.1.12.0/24 is directly connected, Serial1/0
O E2 10.1.3.0/24 [110/20] via 10.1.12.2, 00:03:02, Serial1/0
O 10.1.2.1/32 [110/65] via 10.1.12.2, 00:03:45, Serial1/0
C 10.1.1.0/24 is directly connected, Loopback0
O IA 10.1.23.0/24 [110/128] via 10.1.12.2, 00:03:45, Serial1/0

 

Route 10.1.3.0 is now advertised as E2 route becasue R2 transalated type 7 LSA to type 5 LSA

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s