PracticeLabs
Week 5Lesson 4Required44 min estimated0% progress

Single-Area OSPFv2 Configuration

Configure single-area OSPFv2 two ways — network statements with wildcard masks and interface-level enablement — set a stable router-id, make LAN interfaces passive, and verify the process.

Lesson orientation

What you'll learn (5 objectives)~44 min: video → lesson → check → apply → lab prep

Learning objectives

  • Configure OSPF with a process id and enable it per interface using a correct wildcard mask
  • Enable OSPF at interface level with ip ospf <pid> area <id> and explain when to prefer it
  • Set a deterministic router-id and explain the selection order and how to apply a change
  • Apply passive-interface to advertise a LAN without forming adjacencies on it
  • Verify with show ip protocols and show ip ospf interface brief, and fix a duplicate-RID fault

Terms you will see

Process IDnetwork statementWildcard maskArea 0 / backbonerouter-idpassive-interfaceclear ip ospf process

Time breakdown

  • Read the notes22 min
  • Routing Table Trainer12 min
  • Configuration prediction10 min

Assigned video

Opens on YouTube
Optional video

Free CCNA | OSPF Part 2 | Day 27 | CCNA 200-301 Complete Course

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~8 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • The router ospf process, network statements, and verification on live gear

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

Pick a process, then say which interfaces participate

Enabling OSPF is a two-decision job. The process is created with router ospf <process-id>, and that ID is locally significant — pick any number, it need not match neighbours. The second decision, which interfaces participate, has two valid styles that coexist happily.

Style 1 — network statements, the classic form
R1(config)# router ospf 1
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# network 10.1.12.0 0.0.0.3 area 0

The statement does not advertise a subnet directly. It is a match rule: OSPF examines every local interface, and any interface whose address falls within the given address and wildcard is enabled for OSPF in the stated area. So network 10.1.1.0 0.0.0.255 area 0 enables OSPF on whichever local interface sits in 10.1.1.0/24.

Style 2 — interface level, modern and explicit
R1(config)# interface GigabitEthernet0/1
R1(config-if)# ip ospf 1 area 0

This form is unambiguous — you can see OSPF is on this interface without reverse-engineering a wildcard. Prefer it when you want zero doubt about which interfaces run OSPF; prefer network statements when one line cleanly covers a range. Either way, area 0 is the backbone, and every router in a single-area design lives in it.

The network statement takes a wildcard, not a subnet mask
Subtract each octet of the subnet mask from 255. A /24 mask of 255.255.255.0 gives wildcard 0.0.0.255; a /30 mask of 255.255.255.252 gives 0.0.0.3; a /26 mask of 255.255.255.192 gives 0.0.0.63. Getting it wrong either enables OSPF on interfaces you did not intend, or silently misses the one you wanted — which then never appears in show ip ospf interface brief. This is where most first OSPF configurations go wrong.

Pin the Router ID, and quieten the LANs

OSPF chooses its Router ID at process start: a manual router-id first, else the highest loopback address, else the highest active physical address. Letting it default means an interface flap or a new loopback can silently change the router's identity, and duplicate RIDs across routers cause real faults. Set it explicitly with router-id 1.1.1.1 inside the process.

A RID change needs clear ip ospf process
Changing router-id after the process is already running does not take effect until you run clear ip ospf process, or reload. Forgetting that step produces the familiar 'I set it but it did not change' moment, and it is a favourite exam question.

On a LAN facing end hosts there is no OSPF neighbour to talk to, yet sending Hellos out that interface wastes CPU and — worse — invites a rogue router to peer with you. passive-interface GigabitEthernet0/0 stops Hellos on that port while still advertising its connected network into OSPF.

What passive-interface does not do
It does not remove the route. The LAN is still flooded to the rest of the area — you simply stop forming adjacencies out that port. Apply it to user LANs, and never to a transit link, or you kill the adjacency you need. You can also invert the default with passive-interface default and then selectively re-enable the transit links. This distinction matters again in Lesson 6, where a missing route is often blamed on passive-interface when it cannot be the cause.

Verify the configuration before the routes

Configure R1, then confirm with show ip protocols
R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# network 10.1.12.0 0.0.0.3 area 0
R1(config-router)# passive-interface GigabitEthernet0/0
R1(config-router)# end

R1# show ip protocols
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:
    10.1.1.0 0.0.0.255 area 0
    10.1.12.0 0.0.0.3 area 0
  Passive Interface(s):
    GigabitEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    2.2.2.2              110      00:03:11

show ip protocols is the fastest confirmation that the configuration is right: it echoes the Router ID, the exact network statements with their wildcards, the passive interfaces, and the neighbours it is learning from. Cross-check which interfaces are actually running OSPF with show ip ospf interface brief.

show ip ospf interface brief
Interface    PID   Area    IP Address/Mask    Cost  State Nbrs F/C
Gi0/0        1     0       10.1.1.1/24        1     DR    0/0
Gi0/1        1     0       10.1.12.1/30       1     P2P   1/1

Gi0/1 shows one neighbour Full over Count — the transit adjacency. Gi0/0 shows 0/0 because it is passive: it is in OSPF and advertised, but forms no adjacency. That 0/0 on a LAN is expected, not a fault, and reading it as one sends people hunting for a problem that does not exist.

Troubleshooting — duplicate Router ID
Symptom: after configuring OSPF you see %OSPF-4-DUP_RTRID1 logged, routers exchange incomplete routes, and some remote LANs are missing. Diagnosis: two routers selected or were configured with the same Router ID — both auto-picked from the same range, or both were set to 1.1.1.1. OSPF requires a unique RID per router; a duplicate corrupts the database view and produces missing or unstable routes. Fix: assign a unique router-id on each router, then clear ip ospf process on both so the change takes effect, and confirm in show ip protocols.

What you should retain

  • Enable with network <address> <wildcard> area <id>, a match rule, or per interface with ip ospf <pid> area <id>.
  • The wildcard is the inverse of the subnet mask: /24 gives 0.0.0.255, /30 gives 0.0.0.3.
  • Router ID: manual, then highest loopback, then highest active address. Changes need clear ip ospf process.
  • passive-interface stops Hellos on a LAN but still advertises the connected route — never use it on a transit link.
  • Verify the configuration with show ip protocols and show ip ospf interface brief before looking at routes.
Pause and predictNot scored — nothing is recorded

Before you read on

You configure network 10.1.12.0 0.0.0.255 area 0 — a /24 wildcard — on a router whose only interface in that range is the 10.1.12.1/30 transit link. Does OSPF still come up on that link? What risk did the too-broad wildcard introduce?

Interactive tool
Required~12 min

Routing Table Trainer

Confirm you can pick out O routes and their costs in a table that also contains connected, static, and default entries. Configuration is only half the skill; recognising the result is the other half.

Section quiz

Check this section before moving on

Required8 questions~10 min

OSPF Neighbours & Configuration

The quiz opens on its own page so you can focus on it. It is a Week 1 milestone, tracked separately from this lesson's own completion.

Topics covered

  • Link-state mechanics and the facts worth memorising
  • What must match for an adjacency, and what need not
  • The neighbour state machine and stuck states
  • Network statements, wildcards, router-id, and passive-interface
Start the quiz

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

OSPF

For network-statement versus interface enablement and the complete wildcard rules