SkarpSkarp

Chapter 13 of 27

Configuring and Verifying Single-Area OSPFv2

Translate OSPFv2 theory into CLI skills by configuring single-area OSPF on Cisco routers and validating neighbor relationships and route installation.

27 min readen

From OSPF Theory to CLI Practice

Goal of This Module

You now move from OSPFv2 theory to CLI skills, focusing on configuring and verifying a single OSPF area (Area 0) on Cisco IOS routers.

What You Will Practice

You will configure router IDs, network statements, passive interfaces, and use show commands to check neighbors, the LSDB, and routing tables.

Lab Topology Mental Picture

Visualize three routers: R1–R2 on 10.0.12.0/24, R2–R3 on 10.0.23.0/24, plus loopbacks on each router acting as local LANs.

Outcome

By the end, you should be able to build this single-area OSPFv2 network from scratch and explain every command you typed.

OSPFv2 Router ID: Choosing and Verifying

What Is the Router ID?

The OSPF router ID is a 32-bit dotted-decimal value that uniquely identifies a router within an OSPFv2 domain.

Selection Order

OSPF chooses the router ID in this order: manual `router-id`, then highest loopback IP, then highest physical interface IP.

Why Manual RIDs Matter

Manually setting the RID makes OSPF behavior predictable and stable, even when interfaces go up or down.

Verifying the RID

Use `show ip protocols` or `show ip ospf` to see the current router ID. Changing it requires clearing the OSPF process or reloading.

Lab Setup: IP Addressing and Router IDs

Topology Reference

Three routers: R1–R2 on 10.0.12.0/24, R2–R3 on 10.0.23.0/24, with loopbacks 1.1.1.1, 2.2.2.2, 3.3.3.3 respectively.

Addressing R1 and R2

Assign IPs to R1 G0/0 and loopback0, and R2 G0/0, G0/1, and loopback0, then issue `no shutdown` on physical interfaces.

Addressing R3

Configure R3 G0/0 with 10.0.23.3/24 and loopback0 with 3.3.3.3/32, again ensuring interfaces are up.

Set Router IDs and Test Pings

Under `router ospf 1` set `router-id` on each router, then ping directly connected neighbors to confirm basic IP connectivity.

Enabling Single-Area OSPFv2 with Network Statements

Starting OSPFv2

Use `router ospf <process-id>` to start OSPFv2. The process ID is local; neighbors do not need matching process IDs.

Role of Network Statements

In OSPF, `network` statements select which interfaces run OSPF based on the interface IP and wildcard mask.

Example on R2

`network 10.0.12.0 0.0.0.255 area 0` and `network 10.0.23.0 0.0.0.255 area 0` enable OSPF on the two links; another statement covers the loopback.

Common Exam Trap

Remember: in OSPF, `network` does not directly advertise a prefix; it enables OSPF on matching interfaces, which then advertise their configured networks.

Full OSPFv2 Configuration on R1–R3

R1 OSPF Config

R1 runs `router ospf 1`, sets `router-id 1.1.1.1`, and enables OSPF on 10.0.12.0/24 and the 1.1.1.1/32 loopback.

R2 and R3 OSPF Configs

R2 enables OSPF on both transit links and its loopback; R3 enables OSPF on 10.0.23.0/24 and 3.3.3.3/32.

Expected Adjacencies

Expect OSPF adjacencies: R1–R2 on 10.0.12.0/24 and R2–R3 on 10.0.23.0/24, all in Area 0.

Expected Routes

On R1, you should see `O 2.2.2.2/32` and `O 3.3.3.3/32` in the routing table, learned via OSPF.

Passive Interfaces and Controlling Adjacencies

What Is a Passive Interface?

A passive interface in OSPF stops sending and receiving hellos, so no neighbors form on that interface, but its network is still advertised.

Where to Use Passive Interfaces

Use passive interfaces on user LANs, loopbacks, and any segment without another OSPF router to reduce unnecessary OSPF traffic.

Per-Interface Example

On R1, `passive-interface loopback0` keeps advertising 1.1.1.1/32 but prevents any attempt to form neighbors on the loopback.

Passive by Default Pattern

Use `passive-interface default` then `no passive-interface` on transit links to tightly control where adjacencies are allowed.

OSPF Network Types and Timers (High-Level)

Why Network Types Matter

OSPF network types control how routers discover neighbors, elect DR/BDR, and what default hello/dead timers they use.

Common Types

Broadcast (default on Ethernet) and point-to-point are the main types you see; non-broadcast is mostly for older WAN technologies.

Checking an Interface

Use `show ip ospf interface` to see the network type and hello/dead intervals for a specific interface.

Matching Parameters

For full adjacency, routers must agree on area ID, timers, network type in most cases, authentication, and stub flags.

Core OSPFv2 Verification Commands

Check Neighbors

`show ip ospf neighbor` confirms which neighbors exist and their states; on point-to-point links you expect state Full.

Check the LSDB

`show ip ospf database` displays LSAs in the link-state database, including router and network LSAs in Area 0.

Check Routes

`show ip route ospf` filters the routing table to OSPF-learned routes, tagged with `O` or `O IA`.

Troubleshooting Angle

No neighbors means adjacency issues; neighbors but no OSPF routes usually indicates LSAs, area design, or filtering problems.

Quick Check: Basic Configuration and RIDs

Test your understanding of router IDs and basic OSPFv2 configuration.

On a router with no manual router ID and no loopbacks, which IP will OSPFv2 choose as the router ID?

  1. The lowest IP address on any up/up physical interface
  2. The highest IP address on any up/up physical interface
  3. The first IP address configured on any interface
  4. It cannot form adjacencies without a manual router ID
Show Answer

Answer: B) The highest IP address on any up/up physical interface

OSPFv2 chooses the router ID in this order: manual `router-id`, highest loopback IP, then highest IP on any up/up physical interface. If there are no loopbacks and no manual RID, it selects the highest physical interface IP. It does not require a manual router ID to form adjacencies.

Thought Exercise: Designing Network Statements

Your Scenario

A router has G0/0 (192.168.10.1/24), G0/1 (10.1.0.1/30), and Loopback0 (10.255.255.1/32). All should be in Area 0.

Your Task

Write network statements and choose which interfaces to make passive so user LAN hosts do not see OSPF hellos.

Suggested Network Statements

Use three network statements, one per interface subnet or host address, all pointing to area 0.

Suggested Passive Interfaces

Mark G0/0 and Loopback0 as passive, or use `passive-interface default` then `no passive-interface g0/1`.

Quiz: Verification and Troubleshooting

Apply what you learned about show commands and common issues.

R1 and R2 are connected on 10.0.12.0/24. Both run OSPFv2 in Area 0. `show ip ospf neighbor` on R1 shows R2 stuck in the INIT state. Which of the following is the MOST likely cause?

  1. R1 and R2 have different OSPF process IDs (1 vs 2).
  2. R1 has the interface set as passive, but R2 does not.
  3. R1 and R2 have mismatched hello/dead timers on the interface.
  4. R2 is advertising a default route but R1 is not.
Show Answer

Answer: C) R1 and R2 have mismatched hello/dead timers on the interface.

INIT means R1 is receiving hellos from R2 but R2 is not seeing its own router ID in R1’s hellos. The most common CCNA-relevant cause is mismatched hello/dead timers or area ID. Passive interfaces would prevent hellos entirely (no neighbor entry). Different process IDs are local and do not prevent adjacencies. Default route advertisement does not affect neighbor states.

Common OSPFv2 Issues and a Troubleshooting Flow

Step 1: Start with Basics

Use `show ip interface brief` and `ping` to confirm interfaces are up and IP addressing is correct before blaming OSPF.

Step 2: Is OSPF Running Where It Should?

Check `show ip protocols` and OSPF `network` statements to ensure the right interfaces are in Area 0.

Step 3: Neighbors and Interfaces

Use `show ip ospf neighbor` and `show ip ospf interface` to diagnose missing neighbors or odd neighbor states.

Step 4: LSDB and Routes

Inspect `show ip ospf database` and `show ip route ospf` to verify LSAs exist and routes are installed.

Key OSPFv2 Concepts Review

Flip through these cards to reinforce core terms and commands for configuring and verifying single-area OSPFv2.

OSPFv2 (definition)
Open Shortest Path First version 2 (OSPFv2) is a link-state interior gateway protocol used to exchange IPv4 routing information within a single autonomous system.
Router ID selection order
1) Manually configured `router-id` under `router ospf`; 2) Highest IP address on any up loopback interface; 3) Highest IP address on any up physical interface.
Purpose of OSPF `network` statements
In OSPF, `network` statements select which interfaces run OSPF based on their IP addresses and wildcard masks; those interfaces then advertise their connected networks.
Effect of `passive-interface` in OSPF
OSPF stops sending and receiving hellos on that interface (no neighbors form), but the connected network is still advertised to other OSPF routers.
Command: show ip ospf neighbor
Displays OSPF neighbors, their router IDs, states (Full, 2-Way, etc.), and the interfaces over which adjacencies are formed.
Command: show ip ospf interface
Shows OSPF settings per interface, including area ID, network type, hello and dead intervals, and whether the interface is passive.
Command: show ip route ospf
Filters the routing table to show only routes learned via OSPF, tagged with `O` (intra-area) or `O IA` (interarea).
Default OSPF hello and dead timers on broadcast networks
On broadcast (Ethernet) networks, OSPF typically uses a 10-second hello interval and a 40-second dead interval by default.
Symptoms of mismatched OSPF hello/dead timers
Routers may see each other’s hellos but remain stuck in INIT or 2-Way states and fail to reach Full adjacency.
Why set router IDs manually?
Manual router IDs provide stable, predictable identification that does not change when interfaces flap or IP addresses are modified.

Key Terms

DR/BDR
Designated Router and Backup Designated Router, elected on multi-access networks to reduce OSPF adjacency overhead.
OSPFv2
Open Shortest Path First version 2 (OSPFv2) is a link-state interior gateway protocol used to exchange IPv4 routing information within a single autonomous system.
OSPF area
A logical grouping of OSPF routers and networks that share the same link-state database; Area 0 is the backbone area.
Router ID
A 32-bit value in dotted-decimal notation that uniquely identifies an OSPF router within an autonomous system.
OSPF network type
A mode of operation on an interface (such as broadcast or point-to-point) that influences neighbor discovery, DR/BDR elections, and default timers.
Passive interface
An interface on which a routing protocol does not send or receive hello packets, preventing neighbor formation while still advertising the connected network.
Administrative distance
A value used by routers to rank the trustworthiness of different routing information sources; OSPF’s default is 110.
Network statement (OSPF)
A configuration line under `router ospf` that matches interface IP addresses with a wildcard mask to enable OSPF on those interfaces and assign them to an area.
Link-State Database (LSDB)
The collection of all LSAs that an OSPF router knows about, representing the complete topology of its areas.
LSA (Link-State Advertisement)
A type of OSPF message that describes the state of a router’s links or networks, used to build the LSDB.

Finished reading?

Test your understanding with a custom practice exam on this chapter.

Test yourself