Labs

Lab ipc-04 - OSPF Single-Area

Lab ipc-04 - OSPF Single-Area
In: Labs

OSPF (Open Shortest Path First) is the link-state protocol that powers most enterprise networks. Single-area OSPF puts every router in Area 0 - the backbone - and is the simplest production-grade dynamic routing protocol you can deploy. This lab configures OSPF single-area on R1, R2, R3 of the base topology, watches the DR/BDR election, and confirms end-to-end reachability across the loopbacks.

This is the third of five free preview labs.

What you will learn

  • The router ospf configuration syntax with router-id and network statements
  • OSPF Area 0 (backbone) - every multi-area network has one
  • How OSPF elects a Designated Router (DR) and Backup DR (BDR) on broadcast segments
  • How to read show ip ospf neighbor and the FULL state
  • How OSPF routes appear: O for intra-area

What this lab does NOT cover

  • Multi-area OSPF (ABRs, areas other than 0) - that is the next lab, ipc-05
  • OSPF authentication - covered in ipc-08
  • OSPF in non-broadcast network types - covered in ipc-06

Topology

Download the CCNA Base Topology .yaml

The PingLabz CCNA Base Topology - 3 iol-xe routers + 1 alpine + 1 ioll2-xe switch.

Download CCNA Base Topology

Step 1: Configure OSPF on R1

R1#configure terminal
R1(config)#router ospf 100
R1(config-router)#router-id 10.255.0.1
R1(config-router)#network 10.20.0.0 0.0.0.255 area 0
R1(config-router)#network 10.255.0.1 0.0.0.0 area 0
R1(config-router)#passive-interface Loopback0

Five commands:

  • router ospf 100 - process ID 100. Locally significant; does not have to match between routers.
  • router-id 10.255.0.1 - explicit router-id. Pin it to the loopback for stability.
  • network ... area 0 - enable OSPF on matching interfaces and place them in Area 0. The wildcard mask is the inverse of the subnet mask.
  • passive-interface Loopback0 - do not send Hellos out the loopback (no neighbors there).

Step 2: Same pattern on R2 and R3

R2(config)#router ospf 100
R2(config-router)#router-id 10.255.0.2
R2(config-router)#network 10.20.0.0 0.0.0.255 area 0
R2(config-router)#network 10.30.30.0 0.0.0.3 area 0
R2(config-router)#network 10.255.0.2 0.0.0.0 area 0
R2(config-router)#passive-interface Loopback0

R3(config)#router ospf 100
R3(config-router)#router-id 10.255.0.3
R3(config-router)#network 10.30.30.0 0.0.0.3 area 0
R3(config-router)#network 10.255.0.3 0.0.0.0 area 0
R3(config-router)#passive-interface Loopback0

Step 3: Verify the neighbor state on R1

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.255.0.2        1   FULL/DR         00:00:38    10.20.0.2       Ethernet0/0

One neighbor - R2 (10.255.0.2) - in FULL state. R2 is the DR (Designated Router) on this broadcast segment. R1 lost the DR election because R2 has a higher IP-address tiebreaker on default priorities. R1 is therefore the BDR.

Step 4: Look at OSPF on each interface

R1#show ip ospf interface brief
Interface    PID   Area            IP Address/Mask    Cost  State Nbrs F/C
Lo0          100   0               10.255.0.1/32      1     LOOP  0/0
Et0/0        100   0               10.20.0.1/24       10    BDR   1/1

Lo0 is in "LOOP" state - it advertises but does not form adjacencies (passive). Et0/0 is BDR with 1 neighbor that is FULL (the F/C column means Full / Configured).

Step 5: Look at the routing table

R1#show ip route ospf

Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
O        10.30.30.0/30 [110/20] via 10.20.0.2, 00:00:10, Ethernet0/0
O        10.255.0.2/32 [110/11] via 10.20.0.2, 00:00:19, Ethernet0/0
O        10.255.0.3/32 [110/21] via 10.20.0.2, 00:00:05, Ethernet0/0

O-coded routes (OSPF intra-area). [110/N] is AD/cost. R3's loopback cost is 21 (10 for the LAN + 10 for the P2P + 1 for the loopback). The path is R1 -> R2 -> R3.

Step 6: End-to-end test

R1#ping 10.255.0.3 source Loopback0 repeat 3
Type escape sequence to abort.
Sending 3, 100-byte ICMP Echos to 10.255.0.3, timeout is 2 seconds:
Packet sent with a source address of 10.255.0.1
!!!
Success rate is 100 percent (3/3), round-trip min/avg/max = 3/3/4 ms

Step 7: Look at the LSA database (briefly)

R1#show ip ospf database router self-originate | begin LS age
  LS age: 11
  LS Type: Router Links
  Link State ID: 10.255.0.1
  Advertising Router: 10.255.0.1
  LS Seq Number: 80000005
  Number of Links: 2

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.255.0.1
     (Link Data) Network Mask: 255.255.255.255
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.20.0.2
     (Link Data) Router Interface address: 10.20.0.1
       TOS 0 Metrics: 10

R1's own Router LSA. Two links: the stub (loopback) and the transit (LAN segment via DR 10.20.0.2).

Verification

  • show ip ospf neighbor shows R2 in FULL state as DR
  • show ip ospf interface brief shows R1 as BDR on Et0/0
  • show ip route ospf shows three O-coded routes with [110/cost] pairs
  • Ping from R1 to R3's loopback returns 3/3 success

Troubleshooting matrix

SymptomLikely causeConfirm withFix
Neighbor never goes FULLHello timer or area mismatchshow ip ospf interface on both endsMatch Hello/Dead timers and area
Neighbor stuck in EXSTARTMTU mismatch on the segmentshow interfaces <name> | include MTU on bothMatch MTU or use ip ospf mtu-ignore
Router-id keeps changing on reloadNo explicit router-id; OSPF picks highest active loopbackshow ip ospf | include Router IDSet router-id explicitly under router ospf 100
Wrong router elected DRDefault priority 1 + IP tiebreakershow ip ospf interface <name> | include DR|PrioritySet ip ospf priority 100 on the intended DR (covered in ipc-07)

Engineer's note: production reality

Single-area OSPF is the right design for small networks - sub-50 routers, all in one campus or data center. Beyond that scale, multi-area design becomes necessary to reduce LSA flooding scope and SPF recalculation cost. The dividing line moves over time as hardware gets faster, but the principle stays.

Almost every modern enterprise routing deployment is OSPF (or sometimes IS-IS, which is similar conceptually). EIGRP exists in Cisco-only environments and is fine. BGP is for the WAN edge and the cloud-routing interface. Inside the LAN, OSPF dominates.

Key takeaways

  • Single-area OSPF: every router in Area 0.
  • Configuration: router ospf N + router-id X + network ... area 0 + passive-interface on loopbacks.
  • DR/BDR election happens on broadcast segments. Default priority 1, IP-address tiebreaker.
  • OSPF routes are O-coded with cost in [110/cost].
  • FULL state = adjacency complete; LSAs are flowing.

Up next

Lab ipc-05: OSPF multi-area - add a second area and an ABR.

Written by
More from Ping Labz
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Ping Labz.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.