LAB: OSPF Single Area
Three routers, three LANs, and a triangle of links — all in one OSPF area 0. When OSPF is configured correctly, every router automatically learns every network, and when you disconnect a link, OSPF reconverges and traffic takes the remaining path. That last part is what makes dynamic routing worth the configuration effort.
- Address interfaces and bring them up with no shutdown.
- Enable OSPF process 1 and advertise networks into area 0 with network ... area 0.
- Set explicit router IDs and add passive interfaces on the LAN side.
- Verify adjacencies with show ip ospf neighbor and routing with show ip route ospf.
- Fail a link and observe reconvergence to the alternate path.
Overview and goal
This lab uses three routers connected in a loop: R1–R2, R2–R3, and R1–R3. Each router also has one LAN. The goal is that every router automatically learns all LANs by running OSPF in a single area, and — the part worth watching — that a failed link causes traffic to reroute automatically instead of failing.
network ... area 0 statement per advertised network.
The commands work in Packet Tracer, GNS3, EVE-NG, and on real IOS routers. Prompts such as
R1(config-router)# match what you will see on a real console.
Topology
Addressing plan
| Device | Interface | IP address / mask | OSPF network statement |
|---|---|---|---|
| R1 | GigabitEthernet 0/0 | 10.0.0.1 /30 | network 10.0.0.0 0.0.0.3 area 0 |
| R1 | GigabitEthernet 0/1 | 10.0.2.1 /30 | network 10.0.2.0 0.0.0.3 area 0 |
| R1 | GigabitEthernet 2/0 | 192.168.1.1 /24 | network 192.168.1.0 0.0.0.255 area 0 |
| R2 | GigabitEthernet 0/0 | 10.0.0.2 /30 | network 10.0.0.0 0.0.0.3 area 0 |
| R2 | GigabitEthernet 0/1 | 10.0.1.1 /30 | network 10.0.1.0 0.0.0.3 area 0 |
| R2 | GigabitEthernet 2/0 | 192.168.2.1 /24 | network 192.168.2.0 0.0.0.255 area 0 |
| R3 | GigabitEthernet 0/0 | 10.0.1.2 /30 | network 10.0.1.0 0.0.0.3 area 0 |
| R3 | GigabitEthernet 0/1 | 10.0.2.2 /30 | network 10.0.2.0 0.0.0.3 area 0 |
| R3 | GigabitEthernet 2/0 | 192.168.3.1 /24 | network 192.168.3.0 0.0.0.255 area 0 |
0.0.0.255 for a point-to-point link, which would match four times as much
address space and can drag unintended interfaces into OSPF.
Step 1 — Build the topology
- Add 3 routers (4321 or 2911 in Packet Tracer).
- Connect R1 G0/0 → R2 G0/0, R2 G0/1 → R3 G0/0, and R1 G0/1 → R3 G0/1 using cross-over cables, fibre, or serial links. Routers are end devices on these links, so straight-through copper will not come up reliably.
- Leave one GigabitEthernet 2/0 free on each router for its LAN interface.
clock rate on the DCE side. The hello/dead timers are still 10 s / 40 s when the
network type is point-to-point.
Step 2 — Address the routers
Give every connection its address and bring the interfaces up. R1 first:
Router> enable Router# configure terminal Router(config)# hostname R1 R1(config)# interface gigabitEthernet 0/0 R1(config-if)# ip address 10.0.0.1 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# interface gigabitEthernet 0/1 R1(config-if)# ip address 10.0.2.1 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# interface gigabitEthernet 2/0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# end
Repeat the pattern on R2 (10.0.0.2, 10.0.1.1, 192.168.2.1) and R3 (10.0.1.2, 10.0.2.2, 192.168.3.1). Verify all nine interfaces are up/up:
R3# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 10.0.1.2 YES manual up up GigabitEthernet0/1 10.0.2.2 YES manual up up GigabitEthernet2/0 192.168.3.1 YES manual up up
Step 3 — Enable OSPF on R1, R2, R3
Each router runs OSPF process 1, sets its router ID, advertises its three networks into area 0, and makes the LAN interface passive so no Hellos go toward hosts:
! R1 R1(config)# router ospf 1 R1(config-router)# router-id 1.1.1.1 R1(config-router)# network 10.0.0.0 0.0.0.3 area 0 R1(config-router)# network 10.0.2.0 0.0.0.3 area 0 R1(config-router)# network 192.168.1.0 0.0.0.255 area 0 R1(config-router)# passive-interface GigabitEthernet2/0 R1(config-router)# end
! R2 — mirror for its own links R2(config)# router ospf 1 R2(config-router)# router-id 2.2.2.2 R2(config-router)# network 10.0.0.0 0.0.0.3 area 0 R2(config-router)# network 10.0.1.0 0.0.0.3 area 0 R2(config-router)# network 192.168.2.0 0.0.0.255 area 0 R2(config-router)# passive-interface GigabitEthernet2/0 R2(config-router)# end
! R3 R3(config)# router ospf 1 R3(config-router)# router-id 3.3.3.3 R3(config-router)# network 10.0.1.0 0.0.0.3 area 0 R3(config-router)# network 10.0.2.0 0.0.0.3 area 0 R3(config-router)# network 192.168.3.0 0.0.0.255 area 0 R3(config-router)# passive-interface GigabitEthernet2/0 R3(config-router)# end
Step 4 — Verify neighbours
Give OSPF a few seconds, then ask R1 who it found:
R1# show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DR 00:00:34 10.0.0.2 GigabitEthernet0/0 3.3.3.3 1 FULL/BDR 00:00:31 10.0.2.2 GigabitEthernet0/1
Each row shows the neighbour's router ID (which proves the router IDs were applied),
the state, the address, and the interface. FULL means the databases are synchronised. On a
broadcast Ethernet link you will also see DR/BDR roles; on a strictly point-to-point pair you would see
FULL/—.
Neighbor ID 2.2.2.2 FULL/DR tells you the neighbour chose R2 as its DR for that
segment and R1 is fully adjacent to it. A state stuck at INIT or EXSTART
almost always means mismatched parameters (timers, area, or MTU).
Step 5 — Verify routes
R1# show ip route ospf 10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks O 10.0.1.0/30 [110/2] via 10.0.2.2, 00:02:14, GigabitEthernet0/1 O 192.168.2.0/24 [110/2] via 10.0.0.2, 00:02:14, GigabitEthernet0/0 O 192.168.2.0/24 [110/2] via 10.0.2.2, 00:02:14, GigabitEthernet0/1 O 192.168.3.0/24 [110/1] via 10.0.2.2, 00:02:14, GigabitEthernet0/1
Read the key fields. Every O route is OSPF-learned. The bracketed
[110/2] is administrative distance 110, cost 2. Because all three links
are Gigabit Ethernet (cost 1 with the default 100 Mbps reference), R1 reaches 192.168.2.0/24 with cost 2
two different ways — straight to R2, or via R3 — and OSPF installs both
for equal-cost load balancing.
192.168.3.0/24cost 1: one hop to R3.192.168.2.0/24cost 2: via R2 directly, and via R3 R1→R3→R2.10.0.1.0/30cost 2: the R2–R3 link, reachable only through R3 from R1.
Confirm R2 agrees and sees 192.168.1.0/24 and 192.168.3.0/24 as O routes, and R3 sees the other two
/24 LANs too. If any LAN is missing, check that the corresponding network statement exists
and the interface is up.
Step 6 — Test connectivity
End-to-end tests are the real proof:
R1# ping 192.168.3.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms R1# ping 192.168.2.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms R2# ping 192.168.3.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
Every router reaches every LAN through OSPF alone. Notice you typed no static routes — that is the payoff of a dynamic protocol.
Step 7 — Fail a link and watch reconvergence
Now break the direct R1–R2 link and watch the network heal itself. Shut the interface on one end only (the far end will notice when its dead timer expires at 40 seconds, but the local router reacts immediately):
R1(config)# interface gigabitEthernet 0/0 R1(config-if)# shutdown R1(config-if)# end
R1 immediately loses its neighbour 2.2.2.2 on G0/0 and floods a new LSA for its changed topology. After a short convergence, the routing table still contains 192.168.2.0/24 — only the path changes:
R1# show ip route ospf ... O 192.168.2.0/24 [110/2] via 10.0.2.2, 00:00:14, GigabitEthernet0/1
The route now points to R3 only (R1→R3→R2), and a ping still succeeds:
R1# ping 192.168.2.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
Restore the link when you are done:
R1(config)# interface gigabitEthernet 0/0 R1(config-if)# no shutdown
Within a couple of Hello cycles (10 s) the neighbour returns to FULL and the load
balanced second path reappears. This reconvergence you just watched automated is the entire reason
networks run OSPF rather than hand-managed static routes in a loop topology.
Step 8 — Troubleshooting guide
| Symptom | Probably | To check |
|---|---|---|
No neighbour appears in show ip ospf neighbor | OSPF not enabled on the matching network, area mismatch, interface down, or Hellos blocked. | show ip ospf interface; verify both network statements and the area; show ip interface brief. |
Neighbour stuck at INIT | One router is not running OSPF on the link, or a passive interface is facing the neighbour. | Remove passive-interface from the inter-router link on both ends. |
Neighbour stuck at EXSTART/Exchange | MTU mismatch on the link, or a filtering rule blocking OSPF type 89. | Compare MTU on both interfaces; clear with clear ip ospf process. |
| A /24 LAN is learnt by some routers but not others | The owning router lacks the network statement, or its passive interface list is wrong. | show ip protocols or show running-config | section router ospf on the owner. |
| Route cost looks wrong | Reference bandwidth, cable speed, or interface bandwidth not consistent. | show ip ospf interface brief shows per-interface cost; compare bandwidth settings. |
| Link re-enabled but no reconvergence | Both ends still show shutdown, or one side has a stuck neighbour. | show ip interface brief — want up/up; then clear ip ospf process. |
clear ip ospf process debugger's friend
clear ip ospf process restarts OSPF and forces all adjacencies to rebuild. Use it after a
router-ID change or a stuck neighbour, but expect a few seconds of downtime, and remember it is a
privileged exec command, not a debug.
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.