Official source: Cisco CCNA certification page ↗ · Always confirm exam details with Cisco

OSPF for the CCNA: single-area OSPFv2

Updated October 2026 · Independent guide, not affiliated with Cisco

The CCNA covers single-area OSPFv2: neighbor adjacencies, the DR/BDR election, router IDs and basic configuration. Routing makes up the largest share of the exam (IP Connectivity, 25%).

What OSPF is

Open Shortest Path First is a link-state interior routing protocol. Routers exchange link-state advertisements, build the same map of the area, and run the shortest path first algorithm to choose routes. Its administrative distance is 110.

Neighbor states

Two routers move through these states before they exchange routes: Down, Init, 2-Way, ExStart, Exchange, Loading, Full. On broadcast networks, routers that are neither DR nor BDR stay in 2-Way with each other and go Full only with the DR and BDR.

Timers and addresses

Router ID and the DR/BDR election

The router ID is chosen in this order: a manually configured router-id, then the highest loopback IP, then the highest active physical interface IP. On a broadcast segment the DR is the router with the highest interface priority (default 1), and ties are broken by the highest router ID. A priority of 0 means the router never becomes DR or BDR. The election is not pre-emptive.

Cost

OSPF cost on Cisco devices is the reference bandwidth divided by the interface bandwidth. The default reference bandwidth is 100 Mbps, so FastEthernet is 1 and Gigabit Ethernet also rounds to 1. Change it with auto-cost reference-bandwidth (the same value on every router).

Basic configuration

router ospf 1
 router-id 1.1.1.1
 network 192.168.1.0 0.0.0.255 area 0
 network 10.0.0.0 0.0.0.3 area 0
 passive-interface g0/1

The network command uses a wildcard mask and enables OSPF on any interface whose address falls inside that range. passive-interface stops hellos on LAN-facing ports while still advertising the network. You can also enable OSPF per interface with ip ospf 1 area 0.

Verification commands

show ip ospf neighbor
show ip ospf interface brief
show ip route ospf
show ip protocols

Why neighbors do not form

Copy-ready snippets are in the IOS cheat sheet. Practise in Cisco Packet Tracer with three routers, then check yourself with the quiz.

Frequently asked questions

What is the default OSPF administrative distance?

110.

How is the OSPF router ID chosen?

A configured router-id wins, then the highest loopback IP address, then the highest active interface IP address.

What is the default OSPF hello timer?

10 seconds on broadcast and point-to-point networks, with a 40 second dead timer.

Facts about the exam come from Cisco's CCNA page; always confirm there before booking.