Comprehensive OSPF Network Configuration Lab

Addres Planning and Default Route Configuration


[RouterA-GigabitEthernet0/0/0]ip add 172.16.33.1 29
[RouterA-LoopBack0]ip add 172.16.34.1 24

[RouterB-GigabitEthernet0/0/0]ip add 172.16.33.2 29
[RouterB-LoopBack0]ip add 172.16.35.1 24

[RouterC-Serial4/0/0]ip add 34.0.0.1 24
[RouterC]ip route-static 0.0.0.0 0 34.0.0.2
[RouterC-GigabitEthernet0/0/0]ip add 172.16.33.3 29
[RouterC-LoopBack0]ip add 172.16.36.1 24

[Provider-Serial4/0/0]ip add 34.0.0.2 24
[Provider-Serial4/0/1]ip add 45.0.0.2 24
[Provider-Serial3/0/0]ip add 46.0.0.2 24
[Provider-GigabitEthernet0/0/0]ip add 47.0.0.2 24
[Provider-LoopBack0]ip add 4.4.4.4 24

[RouterE-Serial4/0/0]ip add 45.0.0.1 24
[RouterE]ip route-static 0.0.0.0 0 45.0.0.2
[RouterE-LoopBack0]ip add 172.16.2.1 24

[RouterF-Serial4/0/0]ip add 46.0.0.1 24
[RouterF-Serial4/0/0]ip route-static 0.0.0.0 0 46.0.0.2
[RouterF-GigabitEthernet0/0/0]ip add 172.16.65.1 29
[RouterF-LoopBack0]ip add 172.16.3.1 24

[RouterG-GigabitEthernet0/0/0]ip add 47.0.0.1 24
[RouterG-GigabitEthernet0/0/0]ip route-static 0.0.0.0 0 47.0.0.2
[RouterG-GigabitEthernet0/0/1]ip add 172.16.97.1 29
[RouterG-LoopBack0]ip add 172.16.4.1 24

[RouterH-GigabitEthernet0/0/0]ip add 172.16.97.2 29
[RouterH-LoopBack0]ip add 172.16.92.1 24
[RouterH-GigabitEthernet0/0/1]ip add 172.16.97.9 29

[RouterI-GigabitEthernet0/0/0] ip add 172.16.97.10 29
[RouterI-GigabitEthernet0/0/1]ip add 172.16.129.1 29
[RouterI-LoopBack0]ip add 172.16.130.1 24

[RouterJ-GigabitEthernet0/0/0]ip add 172.16.129.2 29
[RouterJ-LoopBack0]ip add 172.16.131.1 24

[RouterK-GigabitEthernet0/0/0] ip add 172.16.65.2 29
[RouterK-LoopBack0]ip add 172.16.66.1 24
[RouterK-GigabitEthernet0/0/1]ip add 172.16.65.9 29

[RouterL-GigabitEthernet0/0/0]ip add 172.16.65.10 29
[RouterL-LoopBack0]ip add 172.16.160.1 20
[RouterL-LoopBack1]ip add 172.16.176.1 20

Area 0: Building MGRE Environment

RouterC

Star topology with RouterC as the central hub

OSPF uses multicast packets, but MGRE only supports unicast, so pseudo-broadcast must be enabled at the hub


interface Tunnel0/0/0
ip address 172.16.1.1 29
tunnel-protocol gre p2mp
source 34.0.0.1
nhrp network-id 100
nhrp entry multicast dynamic

RouterE


interface Tunnel0/0/0
ip add 172.16.1.2 29
tunnel-protocol gre p2mp
source serial 4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register

RouterF


interface Tunnel0/0/0
ip add 172.16.1.3 29
tunnel-protocol gre p2mp
source s 4/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register

RouterG


interface Tunnel0/0/0
ip add 172.16.1.4 29
tunnel-protocol gre p2mp
source g 0/0/0
nhrp network-id 100
nhrp entry 172.16.1.1 34.0.0.1 register

Starting OSPF and RIP Protocols


[RouterA-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[RouterB-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[RouterC-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
[RouterC-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[RouterE-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[RouterF-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[RouterF-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
[RouterG-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[RouterG-ospf-1-area-0.0.0.0]network 172.16.97.1 0.0.0.0

[RouterH-ospf-1-area-0.0.0.3]network 172.16.0.0 0.0.255.255
[RouterI-ospf-1-area-0.0.0.3]network 172.16.97.10 0.0.0.0
[RouterI-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.3.255
[RouterJ-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.255
[RouterK-ospf-1-area-0.0.0.2]network 172.16.0.0 0.0.255.255
[RouterL-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0

[RouterL-ospf-1-area-0.0.0.2]rip
[RouterL-rip-1]network 172.16.0.0

Route Summarization (LSA Optimization)

Configure on the ABR device corresponding to each area

Folllow with the summarized network result (must use the actual subnet mask of the summarized network)

Summarization essentially summarizes Type 3 and Type 5 LSAs


[RouterC-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[RouterF-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[RouterG-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[RouterI-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[RouterL-ospf-1]asbr-summary 172.16.160.0 255.255.224.0

Area 1: Stub Area Configuration

Stub area configuration requirements: Cannot be a backbone area, cannot have virtual links (V-LINK), cannot have ASBR devices

Rejects learning Type 4 and Type 5 LSAs

Configure RouterC as a totally stubby area, not sending Type 3 LSAs


[RouterA-ospf-1-area-0.0.0.1]stub
[RouterB-ospf-1-area-0.0.0.1]stub
[RouterC-ospf-1-area-0.0.0.1]stub
[RouterC-ospf-1-area-0.0.0.1]stub no-summary

Areas 2 and 3: NSSA Configuration

NSSA (Not-So-Stubby Area) configuration requirements: Cannot be a backbone area, cannot have virtual links (V-LINK), must have ASBR devices

The area will reject learning Type 4 and Type 5 LSAs, while the ABR device in the area generates a Type 7 default route


[RouterF-ospf-1-area-0.0.0.2]nssa no-summary
[RouterK-ospf-1-area-0.0.0.2]nssa no-summary
[RouterL-ospf-1-area-0.0.0.2]nssa no-summary

[RouterG-ospf-1-area-0.0.0.3]nssa no-summary
[RouterH-ospf-1-area-0.0.0.3]nssa no-summary
[RouterI-ospf-1-area-0.0.0.3]nssa no-summary
[RouterI-ospf-2]default-route-advertise

Area 4: Route Redistribution

Convert the illegal ABR to an ASBR for sharing routes between protocols

RouterL is the ASBR, so external routes need to be redistributed into the area


[RouterI-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.3.255
[RouterI-ospf-1]undo a 4
[RouterI]ospf 2 router-id 9.9.9.9
[RouterI-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.255
[RouterI-ospf-1]import-route ospf 2
[RouterL-ospf-1]import-route rip

Convergence Acceleration

Reduce timer intervals, modify hello time settings


[RouterC-Tunnel0/0/0]ospf timer hello 10
[RouterE-Tunnel0/0/0]ospf timer hello 10
[RouterF-Tunnel0/0/0]ospf timer hello 10
[RouterG-Tunnel0/0/0]ospf timer hello 10

NAT and OSPF Authentication


Area Authentication
[RouterA-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456

Interface Authentication
[RouterC-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[RouterC]acl 2000
[RouterC-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[RouterC-Serial4/0/0]nat outbound 2000
[RouterG]acl 2000
[RouterG-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[RouterG-GigabitEthernet0/0/0]nat outbound 2000

Network Segmentation and Subnetting Plan

172.16.0.0/16 -- Borrow 3 bits

172.16.00000000.00000000

172.16.00000000.00000000 -- /19

172.16.0.0/19 --- Backbone Area 0 --- /24/25/26

172.16.00000000.00000000 /24

Area 0

172.16.00000011.00000000 /24

172.16.0.0/24 -- Backbone links (P2P) /30

172.16.00000000.00000100

172.16.0.0/30

172.16.0.4/30

172.16.0.8/30

...

172.16.1.0/24 -- Backbone links (MA) /29

172.16.1.00000000

172.16.1.0/29

172.16.1.8/29

172.16.1.16/29

...

172.16.2.0/24

172.16.3.0/24

172.16.4.0/24

172.16.5.0/24

...

172.16.00100000.00000000 -- /19

172.16.32.0/19 -- Area 1

172.16.32.0/24 -- P2P

172.16.32.0/30

172.16.32.4/30

172.16.32.8/30

172.16.33.0/24 -- MA

172.16.33.0/29

172.16.33.8/29

172.16.33.16/29

172.16.33.24/29

172.16.34.0/24 -- User networks

172.16.35.0/24

...

172.16.64.0/19 -- Area 2

172.16.64.0/24 P2P

172.16.64.0/30

172.16.64.4/30

172.16.64.8/30

172.16.64.12/30

172.16.65.0/24 -- MA

172.16.65.0/29

172.16.65.8/29

172.16.65.16/29

172.16.66.0/24

172.16.67.0/24

172.16.96.0/19 -- Area 3

172.16.96.0/24-P2P

172.16.96.0/30

172.16.96.4/30

172.16.97.0/24-MA

172.16.97.0/29

172.16.97.8/29

172.16.97.16/29

172.16.98.0/24

172.16.99.0/24

172.16.128.0/19 -- Area 4

172.16.128.0/24 -P2P

172.16.128.0/30

172.16.128.4/30

172.16.129.0/24-MA

172.16.129.0/29

172.16.129.8/29

172.16.130.0/24

172.16.131.0/24

172.16.160.0/19 -- RIP

172.16.160.0/24

172.16.161.0/24

Backup:

172.16.192.0/19

172.16.224.0/19

Tags: OSPF Network Configuration Route Redistribution Stub Area NSSA

Posted on Thu, 30 Jul 2026 16:41:47 +0000 by greywire