In this lab you will build a two-area OSPF network in Cisco Packet Tracer: Area 0 (the backbone) and Area 1, joined by an Area Border Router. You will configure three routers and two PCs, verify every step with show commands, and understand what each output means. By the end you will be able to explain multi-area OSPF in an interview and build it from scratch.
- Why multi-area OSPF?
- Topology and requirements
- IP addressing scheme
- Objective 1: Configure IPs and verify interfaces
- Objective 2: Test connectivity between neighbors
- Objective 3: Configure OSPF with router IDs and areas
- Objective 4: Verify OSPF neighbors
- Objective 5: Identify the ABR and router roles
- Objective 6: Check the routing table (O and O IA)
- Objective 7: Inspect the LSDB and LSA types
- Objective 8: End-to-end test PC1 to PC2
- Objective 9: Make LAN interfaces passive
- Troubleshooting checklist
- Command cheat sheet
Why multi-area OSPF?
In a single-area OSPF network, every router keeps the same link-state database (LSDB) and runs the SPF algorithm on all of it. That works for a small network, but as the network grows, three problems appear:
- Large LSDB: every router stores every link in the network, which uses more memory.
- Frequent SPF runs: one flapping link anywhere makes every router recalculate.
- Large routing tables: there is no easy place to summarize routes.
Multi-area OSPF solves this by splitting the network into areas. Each router keeps a detailed LSDB only for its own area, and learns about other areas as summarized routes through the Area Border Router (ABR). A topology change inside Area 1 triggers SPF only inside Area 1.
Key rules to remember
- Area 0 is the backbone. Every other area must connect to Area 0, directly or through a virtual link.
- Routers inside one area share the same detailed LSDB.
- Traffic between two non-backbone areas passes through Area 0.
OSPF router types in this lab
| Router | Type | Why |
|---|---|---|
| R1 | Internal router | All its interfaces are in Area 1 |
| R2 | ABR (Area Border Router) | One interface in Area 1, one in Area 0 |
| R3 | Internal router and backbone router | All its interfaces are in Area 0 |
Topology and requirements
R2 sits on the border between the two areas. Its G0/0/0 interface faces Area 1 and its G0/0/1 interface faces Area 0.
What you need
- Cisco Packet Tracer (any recent version)
- 3 routers (Cisco ISR 4321 or 4331, which have GigabitEthernet0/0/0 and 0/0/1)
- 2 PCs
- Copper cross-over cables between router-to-router and PC-to-router links (or use Packet Tracer's automatic cable)
IP addressing scheme
Every router-to-router link uses a /30 subnet (only two usable addresses), which is the standard choice for point-to-point links.
| Device | Interface | IP address | Subnet mask | OSPF area |
|---|---|---|---|---|
| R1 | G0/0/0 (LAN) | 192.168.1.1 | 255.255.255.0 (/24) | 1 |
| R1 | G0/0/1 | 10.0.12.1 | 255.255.255.252 (/30) | 1 |
| R2 | G0/0/0 | 10.0.12.2 | 255.255.255.252 (/30) | 1 |
| R2 | G0/0/1 | 10.0.23.1 | 255.255.255.252 (/30) | 0 |
| R3 | G0/0/0 | 10.0.23.2 | 255.255.255.252 (/30) | 0 |
| R3 | G0/0/1 (LAN) | 192.168.2.1 | 255.255.255.0 (/24) | 0 |
| PC1 | NIC | 192.168.1.10 | 255.255.255.0 (/24) | 1 |
| PC2 | NIC | 192.168.2.10 | 255.255.255.0 (/24) | 0 |
Default gateways: PC1 uses 192.168.1.1 and PC2 uses 192.168.2.1.
Router IDs: R1 = 1.1.1.1, R2 = 2.2.2.2, R3 = 3.3.3.3
Tip: Try each objective yourself first. Then compare your configuration and output with the ones below.
First place the devices and connect the cables as shown in the topology. Then configure the IP address on every router interface and turn the interface on with no shutdown. Router interfaces are shut down by default.
R1
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# interface g0/0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface g0/0/1
R1(config-if)# ip address 10.0.12.1 255.255.255.252
R1(config-if)# no shutdown
R1(config-if)# end
R2
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# interface g0/0/0
R2(config-if)# ip address 10.0.12.2 255.255.255.252
R2(config-if)# no shutdown
R2(config-if)# exit
R2(config)# interface g0/0/1
R2(config-if)# ip address 10.0.23.1 255.255.255.252
R2(config-if)# no shutdown
R2(config-if)# end
R3
Router> enable
Router# configure terminal
Router(config)# hostname R3
R3(config)# interface g0/0/0
R3(config-if)# ip address 10.0.23.2 255.255.255.252
R3(config-if)# no shutdown
R3(config-if)# exit
R3(config)# interface g0/0/1
R3(config-if)# ip address 192.168.2.1 255.255.255.0
R3(config-if)# no shutdown
R3(config-if)# end
PC1 and PC2
Click the PC, open Desktop, then IP Configuration, and enter:
- PC1: IP 192.168.1.10, mask 255.255.255.0, gateway 192.168.1.1
- PC2: IP 192.168.2.10, mask 255.255.255.0, gateway 192.168.2.1
Verify
Run this on every router:
R2# show ip interface brief
Expected on R2 (the other routers look similar with their own addresses):
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 10.0.12.2 YES manual up up
GigabitEthernet0/0/1 10.0.23.1 YES manual up up
Both Status and Protocol must say up. If you see "administratively down", you forgot no shutdown. If the status is down, check the cable and the interface numbers.
Before adding any routing protocol, confirm that each link works. OSPF neighbors cannot form over a link that cannot even ping.
R1# ping 10.0.12.2
R2# ping 10.0.23.2
R3# ping 192.168.2.10
Expected output (the first packet may be lost while the router resolves ARP):
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.12.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
A success rate of 80 or 100 percent is fine. At this stage, PC1 cannot ping PC2 yet, because R1 and R3 do not know the remote LANs. OSPF will fix that.
Now enable OSPF. Three things matter here:
- Process ID (
router ospf 1): only locally significant. It does not have to match between routers. - Router ID: a unique 32-bit identifier. We set it manually so the output is easy to read.
- Network statements: they tell OSPF which interfaces to enable and which area each one belongs to. They use a wildcard mask (the inverse of the subnet mask): /24 becomes 0.0.0.255 and /30 becomes 0.0.0.3.
R1 (Area 1)
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 192.168.1.0 0.0.0.255 area 1
R1(config-router)# network 10.0.12.0 0.0.0.3 area 1
R1(config-router)# end
R2 (ABR: Area 1 and Area 0)
R2(config)# router ospf 1
R2(config-router)# router-id 2.2.2.2
R2(config-router)# network 10.0.12.0 0.0.0.3 area 1
R2(config-router)# network 10.0.23.0 0.0.0.3 area 0
R2(config-router)# end
R3 (Area 0)
R3(config)# router ospf 1
R3(config-router)# router-id 3.3.3.3
R3(config-router)# network 10.0.23.0 0.0.0.3 area 0
R3(config-router)# network 192.168.2.0 0.0.0.255 area 0
R3(config-router)# end
Within a few seconds you should see log messages like this (here on R3, when it forms its adjacency with R2):
%OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/0/0 from LOADING to FULL, Loading Done
Remember: the area on the R2 network statement decides which area each link belongs to. R2 must have area 1 on the link to R1 and area 0 on the link to R3. That is what makes it an ABR.
Save the configuration on all routers with write memory (or copy running-config startup-config).
R2# show ip ospf neighbor
Expected output on R2:
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/BDR 00:00:36 10.0.12.1 GigabitEthernet0/0/0
3.3.3.3 1 FULL/DR 00:00:33 10.0.23.2 GigabitEthernet0/0/1
How to read it:
- Neighbor ID: the router ID of the neighbor, which is why setting router IDs helps.
- State FULL: the routers have exchanged their databases and are fully adjacent. This is the state you want.
- DR/BDR: on Ethernet links, OSPF elects a Designated Router (DR) and Backup DR. With equal priority, the highest router ID wins. That is why R3 (3.3.3.3) is DR on its link with R2, and R2 (2.2.2.2) is DR on its link with R1.
- Dead Time: counts down from 40 seconds and resets every time a Hello packet arrives.
R1 and R3 each show one neighbor (R2). R2 shows two.
If a neighbor is stuck in INIT, 2-WAY or EXSTART, see the troubleshooting checklist at the end.
R2# show ip ospf
Look for these lines on R2:
Routing Process "ospf 1" with ID 2.2.2.2
...
It is an area border router
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
Area BACKBONE(0)
Area 1
The line It is an area border router confirms R2 is the ABR, and the area list shows it belongs to both Area 0 and Area 1.
Now run the same command on R1. You will see only one area and no ABR line:
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Area 1
R3 shows only the backbone area. So the roles are: R1 is an internal router in Area 1, R2 is the ABR, and R3 is an internal (backbone) router in Area 0.
R1# show ip route ospf
Expected on R1 (timers will differ):
10.0.0.0/30 is subnetted, 2 subnets
O IA 10.0.23.0 [110/2] via 10.0.12.2, 00:03:41, GigabitEthernet0/0/1
O IA 192.168.2.0/24 [110/3] via 10.0.12.2, 00:03:41, GigabitEthernet0/0/1
Understand the code O IA:
- O means an OSPF route learned from inside the same area (intra-area).
- O IA means an OSPF inter-area route, learned from a different area through the ABR. R1 learned these from R2.
- [110/3] means administrative distance 110 and OSPF cost 3. With the default reference bandwidth of 100 Mbps, each GigabitEthernet link costs 1, so the path to 192.168.2.0/24 is 1 + 1 + 1 = 3.
- via 10.0.12.2 is the next hop, R2's interface in Area 1.
Now check R3. It should mirror R1: O IA routes for 10.0.12.0/30 and 192.168.1.0/24 through 10.0.23.1. On R2, the remote LAN routes show up as plain O routes, because R2 is attached to both areas and learns each side's networks directly.
R2# show ip ospf database
On the ABR you will see two separate databases, one per area. The output is long, so here is what to look for in each section:
| Area | Section in output | Entries you should see |
|---|---|---|
| Area 1 | Router Link States (Type 1) | 1.1.1.1 and 2.2.2.2 |
| Area 1 | Net Link States (Type 2) | 10.0.12.2 (the DR interface on the R1-R2 link, advertised by 2.2.2.2) |
| Area 1 | Summary Net Link States (Type 3) | 10.0.23.0 and 192.168.2.0, both advertised by 2.2.2.2 |
| Area 0 | Router Link States (Type 1) | 2.2.2.2 and 3.3.3.3 |
| Area 0 | Net Link States (Type 2) | 10.0.23.2 (the DR interface on the R2-R3 link, advertised by 3.3.3.3) |
| Area 0 | Summary Net Link States (Type 3) | 10.0.12.0 and 192.168.1.0, both advertised by 2.2.2.2 |
What the LSA types mean
- Type 1 (Router LSA): every router describes its own links and their costs. It stays inside the area.
- Type 2 (Network LSA): created by the DR on a multi-access segment. It lists the routers attached to that segment. It stays inside the area.
- Type 3 (Summary LSA): created by the ABR. It carries the networks of one area into another. This is how R1 learns about 192.168.2.0/24 without knowing anything about R3's links.
This is the heart of multi-area OSPF: R1 does not have R3's Type 1 LSA in its database. It only knows a Type 3 summary advertised by R2. You can confirm this by running show ip ospf database on R1 and checking that only 1.1.1.1 and 2.2.2.2 appear as Router LSAs.
On PC1, open Desktop then Command Prompt:
C:\> ping 192.168.2.10
Pinging 192.168.2.10 with 32 bytes of data:
Request timed out.
Reply from 192.168.2.10: bytes=32 time=1ms TTL=125
Reply from 192.168.2.10: bytes=32 time=1ms TTL=125
Reply from 192.168.2.10: bytes=32 time=1ms TTL=125
Ping statistics for 192.168.2.10:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss)
The first request times out because of ARP resolution. Run the ping again and all replies should succeed. The TTL of 125 shows the packet crossed three routers (128 minus 3).
Now trace the path:
C:\> tracert 192.168.2.10
Tracing route to 192.168.2.10 over a maximum of 30 hops:
1 1 ms 0 ms 0 ms 192.168.1.1
2 0 ms 1 ms 0 ms 10.0.12.2
3 1 ms 0 ms 0 ms 10.0.23.2
4 1 ms 1 ms 1 ms 192.168.2.10
Trace complete.
The four hops are R1, R2, R3 and finally PC2. Traffic from Area 1 crosses the backbone to reach the other LAN.
R1's G0/0/0 and R3's G0/0/1 connect to PCs, not routers. Right now OSPF still sends Hello packets out of them every 10 seconds, which is useless traffic and a small security risk (anyone plugged into that port could try to form an adjacency). Making the interface passive stops the Hellos but still advertises the network in OSPF.
R1(config)# router ospf 1
R1(config-router)# passive-interface g0/0/0
R3(config)# router ospf 1
R3(config-router)# passive-interface g0/0/1
Verify:
R1# show ip protocols
Look for the passive interface list near the bottom of the output:
Routing Protocol is "ospf 1"
Router ID 1.1.1.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Routing for Networks:
192.168.1.0 0.0.0.255 area 1
10.0.12.0 0.0.0.3 area 1
Passive Interface(s):
GigabitEthernet0/0/0
Routing Information Sources:
Gateway Distance Last Update
2.2.2.2 110 00:01:12
Distance: (default is 110)
Run show ip route ospf on R3 again. 192.168.1.0/24 should still be there, and PC1 can still ping PC2. Passive only affects neighbor formation, not route advertisement.
Finally, save the configuration on all three routers with write memory.
Troubleshooting checklist
If OSPF does not work, check these in order:
| Symptom | Likely cause | What to check |
|---|---|---|
| No neighbor at all | Interface down, wrong IP or wrong network statement | show ip interface brief, show ip ospf interface brief |
| Neighbor stuck in INIT | Hellos going one way only, or a mismatch | Cabling, ACLs, interface status on both ends |
| Neighbor never reaches FULL | MTU mismatch or duplicate router ID | show ip ospf neighbor, show ip protocols |
| No adjacency though ping works | Area ID, subnet or Hello/Dead timer mismatch | show ip ospf interface g0/0/0 on both routers |
| Routes missing on one side | Network statement missing or in the wrong area | show running-config | section ospf |
| PC cannot ping the other PC | Wrong PC gateway or mask | PC IP configuration, then trace with tracert |
Two routers must agree on area ID, subnet, Hello and Dead timers (and authentication, if used) to become neighbors. A very common mistake is entering the wrong wildcard mask, for example 0.0.0.255 on a /30 link, or putting a network in the wrong area on the ABR.
Command cheat sheet
| Command | What it shows |
|---|---|
show ip interface brief | Interface IPs and up/down status |
show ip ospf neighbor | Neighbors, their state and the interface they were learned on |
show ip ospf | Router ID, areas, and whether the router is an ABR |
show ip ospf interface brief | OSPF-enabled interfaces with area, cost and state |
show ip route ospf | Only OSPF routes (O and O IA) |
show ip ospf database | The LSDB, per area, with LSA types |
show ip protocols | Networks, passive interfaces and sources of routing information |
show running-config | section ospf | The OSPF part of the configuration |
Quick recap
- Multi-area OSPF keeps each router's LSDB small by splitting the network into areas.
- Area 0 is the backbone, and every other area connects to it.
- The ABR (R2) has interfaces in more than one area and passes summaries between them as Type 3 LSAs.
- Routes from another area show as O IA in the routing table.
- Passive interfaces stop OSPF Hellos on LAN ports without hiding the network.
Practice ideas
- Shut down the R2-R3 link and watch how the routing tables and neighbor list change.
- Add loopback interfaces on R1 and summarize them at the ABR with
area 1 range. - Change the reference bandwidth with
auto-cost reference-bandwidthand see how the costs change.
Network Engineer Stuff: CCNA, routing and Packet Tracer labs.
Watch the video version of this lab on YouTube: Network Engineer Stuff.
Questions or doubts? WhatsApp +91-8828002605 or email networkengineerstuff@gmail.com.
Instagram: @networkengineerstuff | Facebook: NetworkEngineerStuff | www.networkengineerstuff.blogspot.com
