OSPF single-area configuration
Configure single-area OSPFv2: process ID, router ID, network statements or interface OSPF, passive interfaces, and adjacency verification.
OSPF fundamentals and router ID
OSPFv2 is a link-state IGP: routers flood link-state advertisements inside an area, build an identical topology map, and each computes shortest paths independently. Single-area OSPF commonly uses area 0 in examples, though any single area number is valid. The process ID is locally significant — it need not match between routers.
The router ID is a 32-bit dotted identifier — it may happen to equal a reachable interface address, but the identifier itself does not imply reachability. Selection order: explicit router-id → highest loopback IPv4 → highest up physical interface IPv4. The RID must be unique in the domain; change it and OSPF re-converges.
Configuring single-area OSPF
Enable OSPF on the LAN and WAN interfaces — Privileged EXEC → Router + interface configuration
Cisco IOS / IOS XE
- Know which interfaces should form adjacencies versus advertise their subnets passively.
configure terminal router ospf 1 router-id 1.1.1.1 network 10.0.0.0 0.0.0.3 area 0 network 192.168.10.0 0.0.0.255 area 0 passive-interface gigabitethernet0/2 end
show ip ospf neighbor show ip protocols show ip ospf interface brief show ip route ospf
- Neighbors reach FULL state.
- Only intended interfaces are enabled for OSPF; passive ones are marked passive.
- OSPF (O) routes install in the table.
- Alternative:
ip ospf 1 area 0under each interface — simpler and more precise. - Wildcard masks on network statements are inverse masks (like ACLs), not subnet masks.
Changes device configuration.
- Interfaces
- Gi0/1 10.0.0.1/24, Gi0/2 192.168.10.1/24, Lo0 1.1.1.1/32
- Gi0/1: network 10.0.0.0 0.0.0.255 area 0 (wildcard for /24).
- Gi0/2: network 192.168.10.0 0.0.0.255 area 0 (wildcard for /24).
- Loopback: either a network statement or leave it — the RID is already set explicitly.
Wildcard = inverse mask: 255.255.255.252 → 0.0.0.3.
Passive interfaces advertise their subnet but send no hellos — recommended on LANs where no adjacency is intended, so the edge network reaches the LSDB without forming pointless neighbor attempts.
Adjacencies and verification
Adjacency requirements
| Must match | If mismatched |
|---|---|
| Hello and dead intervals | Neighbors never form — a fixed mismatch prevents adjacency, it does not create stable flapping |
| Area ID | No adjacency |
| Subnet/mask (broadcast) | Stuck — masks must agree |
| Authentication | Packets rejected |
| MTU | Adjacency stalls in ExStart/Exchange |
| Area type flags (stub/NSSA) | No adjacency |
Network type doesn't have to match for adjacency to form — but mismatched DR expectations break the database.
Neighbor ID Pri State Dead Time Address InterfaceRID, DR priority, state, timer, neighbor IP.2.2.2.2 1 FULL/BDR 00:00:38 10.0.0.2 Gi0/1FULL = synchronized; BDR is its role on this segment.3.3.3.3 1 FULL/DR 00:00:33 10.0.0.3 Gi0/1DR role belongs to the neighbor.Common mistakes
- Using subnet masks instead of wildcards in network statements — the commonest OSPF config error.
- Expecting process IDs to match neighbors — they're locally significant.
- Forgetting
ipv6-style thinking — OSPFv2 is IPv4 only; IPv6 uses OSPFv3. - Changing the RID without clearing — neighbors may need re-establishment.
- Enabling OSPF on WAN links without
ip ospf network point-to-pointwhere appropriate.
Observation: Two routers share a link; neither sees the other in show ip ospf neighbor.
- network statements don't cover the link interface
- Hello/dead or area mismatch
- Interface passive or an ACL blocking OSPF (IP protocol 89)
| Check | Indicates |
|---|---|
show ip ospf interface brief | The interface must be listed as OSPF-enabled. |
show ip protocols | Reveals networks actually enabled for OSPF. |
debug ip ospf adj | Names the mismatch (hello/dead, area, MTU). |
| ACLs permitting IP protocol 89 | OSPF is its own IP protocol — not TCP/UDP. |
Correction: Fix the network statement/interface OSPF or the mismatched parameters.
Neighbor reaches FULL and routes appear.
Related resources
Sources
- Cisco CCNA 200-301 v1.1 Exam Topics (official PDF) — reviewed 2026-11-02
- RFC 2328 — OSPF Version 2 — reviewed 2026-11-02
- Cisco — IP Routing: OSPF Command Reference — reviewed 2026-11-02
Targets CCNA 200-301 v1.1 objectives. Supplemental blocks are labeled beyond exam scope.