Single-Area OSPFv2 Routing Configuration

M. Ichsanul Fadhil•November 19, 2026•7 min read

Learn link-state routing with single-area OSPFv2. Explore neighbor adjacencies, SPF calculation, and configure Cisco router OSPF dynamic routing.

ospf.simneta
Topology Preview

When an enterprise network grows beyond a handful of switches, managing static routes becomes an impossible operational burden. Every time a link fails or a technician plugs in a new subnet, an engineer must manually update dozens of routing tables across the campus.

If a cable snaps along a critical path, static routes keep pointing into the dark, dropping user packets until someone logs in and reconfigures the network by hand.

Dynamic routing protocols solve this challenge by allowing routers to discover neighbors, exchange topology maps, and calculate backup paths automatically. In this lab, we build a redundant diamond transit network running Open Shortest Path First Version 2 (OSPFv2) in Single-Area Backbone 0, silence chatter on user ports, and inject an Internet gateway default route.

The 7 Stages of Neighbor Adjacency: Building Trust Step by Step

Unlike simple protocols that broadcast their entire routing table to anyone listening, OSPF is methodical and cautious. Before two Cisco routers exchange a single route, they must pass through a strict seven-stage handshake to form a trusted neighbor adjacency.

The handshake starts in the Down state. When OSPF turns on, the router sends multicast Hello packets to 224.0.0.5 every 10 seconds. When a neighbor receives this Hello, it enters the Init state. Once both routers see their own Router IDs listed in each other's Hello packets, they reach the 2-Way state.

From 2-Way, the routers negotiate who speaks first in ExStart using their unique 32-bit Router IDs. During the Exchange state, they swap compact Database Description (DBD) packets to see what links each router knows about.

If a router discovers it is missing details about a link, it requests the full record using a Link-State Request (LSR) and receives Link-State Updates (LSU) in the Loading state. Once all Link-State Databases (LSDB) match identically, the adjacency reaches the Full state and normal traffic routing begins.

The 7-Stage OSPF Neighbor Adjacency Lifecycle

Figure 1. The Seven Neighbor Adjacency States: From Down to Full Synchronization

Dijkstra's Math: SPF Tree Calculation and Path Costs

Once the Link-State Database synchronizes across all routers, every device holds the exact same map of the entire network. However, having a map is only half the battle; the router must choose the shortest, fastest path to each destination.

Each router places itself as the root node of an independent tree and executes Dijkstra's Shortest Path First (SPF) algorithm. OSPF calculates path preference using a metric called Cost, which is inversely proportional to link speed: Cost = Reference Bandwidth (100 Mbps) / Interface Bandwidth.

Under the default 100 Mbps reference bandwidth, FastEthernet (100 Mbps) has a cost of 1, and GigabitEthernet (1000 Mbps) also rounds to a minimum cost of 1.

In our diamond topology, Router R4 has two equal-cost paths to reach Edge Router R1: the upper path across R2 (Cost 1 + Cost 1 = 2) and the lower path across R3 (Cost 1 + Cost 1 = 2). Because both paths have identical cumulative costs, OSPF performs Equal-Cost Multi-Path (ECMP) load balancing, providing automatic redundancy if either transit link fails.

Dijkstra SPF Algorithm and Link Cost Calculation

Figure 2. Dijkstra SPF Path Selection: Calculating Link Cost across the Diamond Transit Mesh

Quiet on the Edge: Protecting Campus LANs with Passive Interfaces

When you activate OSPF on a router interface, the router immediately starts sending multicast Hello packets out of that port every 10 seconds. On inter-router transit links, these Hellos are necessary to monitor neighbor health.

However, on the user-facing campus LAN port (such as R4 GigabitEthernet0/0 connecting to Switch SW1 and PC1), sending OSPF Hello packets is inefficient and risky. End-user workstations do not run OSPF, so processing periodic multicast packets only wastes endpoint CPU cycles and network bandwidth.

More importantly, leaving OSPF active on access ports creates a security hole. If an unauthorized user or infected laptop runs routing software on the local subnet, they could form an adjacency with R4 and inject rogue routing updates directly into Backbone Area 0.

The passive-interface command solves both problems cleanly. It tells R4 to advertise the 192.168.1.0/24 subnet to fellow OSPF neighbors, but completely suppresses outgoing Hello packets and refuses any incoming adjacency requests on that physical port.

Edge Security: Active Adjacency vs Passive Interface

Figure 3. Edge Hardening: Suppressing Hello Multicasts on User Ports with Passive Interfaces

Reaching the Outside World: Default Route Propagation and End-to-End Flow

Campus workstations need access to servers on the public Internet, but internal routers like R2, R3, and R4 have no direct connection to the ISP. Manually typing a static default route on every single router would defeat the purpose of running dynamic routing.

The professional solution is default route propagation from the network edge. Border Router R1 connects directly to ISPR1 via GigabitEthernet3/0 (203.0.113.1/30) and holds a static route pointing toward the ISP gateway (203.0.113.2).

By issuing default-information originate inside the OSPF process on R1, the edge router generates an OSPF Type 5 External LSA. R1 automatically advertises an external default route (O*E2 0.0.0.0/0) to R2 and R3, which in turn pass it down to R4.

When PC1 (192.168.1.10) sends an ICMP ping to ISPR1 (203.0.113.2), R4 looks up its OSPF routing table, sees the dynamic external default route, forwards the packet through the diamond transit mesh to R1, and exits cleanly to the ISP gateway with sub-millisecond response.

Diamond Topology and Default Route Propagation

Figure 4. Diamond Redundant Mesh: Dynamic Default Route Injection and End-to-End Ping Flow

Hands-On Practice: Configuration and Verification Guide

Now that you understand neighbor states, SPF cost calculations, and default route injection, launch the interactive topology playground above to build the complete Single-Area OSPFv2 infrastructure.

Start by configuring OSPF process 1 on all four internal routers (R1 through R4). Assign manual Router IDs matching their Loopback 0 addresses to establish clean identification during neighbor elections.

Use wildcard masks to bind all transit subnets to Area 0. On Router R4, configure GigabitEthernet0/0 as a passive interface so the campus LAN remains safe and quiet. Finally, originate the external default route from Edge Router R1.

Use standard Cisco verification commands to inspect your network health:

R4# show ip ospf neighbor
! Verify that neighbor adjacencies with R2 and R3 reach the FULL state

R4# show ip route ospf
! Check for OSPF inter-router routes and the O*E2 default route to the ISP

PC1> ping 203.0.113.2
! Verify complete multi-hop reachability from the campus LAN to the ISP gateway

When all five ping packets return successfully with zero loss, you have built a resilient, self-healing OSPF routing domain ready for enterprise production traffic.

Discussion & Community Notes

Ask questions, share configuration solutions, or discuss this practice lab.

0 Comments
Posting as Guest • 1-level replies supported