Course menu

Course 9: OSPFLesson 5.3 (15 of 20 in this course)84 of 118 in the CCNA series

OSPF cheat sheet

Defaults, timers, neighbour requirements and states, packet and LSA types, network types, route codes and commands on one page.

Intermediate · 6 min read

What you will learn

After this lesson, you can look up any OSPF default, state, LSA type or command in one place while you practise or revise.

  • Revision
  • Reference

OSPFv2 is the link-state interior routing protocol for IPv4 defined in RFC 2328. Routers form adjacencies, flood LSAs so every router in an area holds the same database, and run SPF to choose the lowest-cost path to each network.

In simple terms: Routers share one map and each works out its own shortest path on it.

Everything from the course on one page, for revision and for use beside a lab. Each row links back to an idea explained properly in the lessons.

Defaults and numbers

ItemValue
IP protocol number89 (not TCP or UDP)
Multicast addresses224.0.0.5 all OSPF routers · 224.0.0.6 DR and BDR
Administrative distance110
Hello / dead, broadcast and point-to-point10 s / 40 s
Hello / dead, non-broadcast and point-to-multipoint30 s / 120 s
Wait timer (DR election)Equal to the dead interval
Reference bandwidth100 Mbps (auto-cost reference-bandwidth, in Mbps)
Interface costReference ÷ bandwidth, rounded down, 1 to 65 535
Interface priority1 (range 0 to 255; 0 = never DR or BDR)
Equal-cost paths installed4 (maximum-paths)
LSA refresh / MaxAge30 minutes / 60 minutes
Default route (default-information originate)Type 5, E2, metric 1

Router ID

  1. router-id under router ospf,
  2. otherwise the highest IPv4 address on an up loopback,
  3. otherwise the highest IPv4 address on any other up interface.

Chosen when the process starts. A change takes effect after clear ip ospf process or a reload.

Neighbours

Must match (in the hello)Must also be rightDoesn't need to match
Area ID · subnet and mask · hello and dead intervals · authentication · stub area flagUnique router IDs · IP MTU (checked in DBDs) · interface not passive · same network typeProcess ID · priority · cost
StateMeaningStuck here usually means
DownNothing heardNot in OSPF, passive, area or timer or auth mismatch, ACL
AttemptPolling a configured neighbour (NBMA only)Neighbour unreachable
InitHello heard, my RID not in itHellos only arrive one way
2-WayBoth see each other; DR/BDR electedNormal between two DROthers
ExStartChoosing master (higher RID)MTU mismatch, duplicate RID
ExchangeSwapping DBDs (LSA headers)MTU mismatch
LoadingLSR and LSU for missing LSAsCorrupt or very large LSAs (rare)
FullDatabases identicalHealthy

Packets and LSAs

PacketJob
1 HelloFind and keep neighbours, elect DR/BDR
2 DBDList of LSA headers (the table of contents)
3 LSRRequest missing LSAs
4 LSUCarry full LSAs
5 LSAckAcknowledge LSUs
LSACreated byScopeRoute code
1 RouterEvery routerIts areaO
2 NetworkDR of a multi-access segmentIts areaO
3 SummaryABRInto other areasO IA
5 ExternalASBRWhole OSPF domain (normal areas)O E1 / O E2

Network types

TypeDefault onDRTimers
BroadcastEthernetYes10/40
Point-to-pointSerial HDLC/PPP, tunnelsNo10/40
Non-broadcastFrame RelayYes30/120
Point-to-multipointConfigured onlyNo30/120
LoopbackLoopbacksNoAdvertised as /32

Configuration

router ospf 1 router-id 1.1.1.1 auto-cost reference-bandwidth 10000 network 10.0.12.0 0.0.0.3 area 0 passive-interface default no passive-interface GigabitEthernet0/1 default-information originate maximum-paths 4

Process-level commands. The process ID is local; the router ID must be unique.

interface GigabitEthernet0/1 ip ospf 1 area 0 ip ospf network point-to-point ip ospf cost 10 ip ospf priority 0 ip ospf hello-interval 10 ip ospf dead-interval 40 bandwidth 100000

Interface-level commands. ip ospf area overrides a matching network statement; ip ospf cost overrides the bandwidth calculation.

Verification

CommandLook for
show ip protocolsRouter ID, networks, passive interfaces, sources
show ip ospfRouter ID, reference bandwidth, areas, ASBR/ABR, SPF runs
show ip ospf interface briefInterfaces in OSPF, area, cost, state, neighbours F/C
show ip ospf interface <if>Network type, priority, DR/BDR, timers, passive
show ip ospf neighborNeighbour RIDs, state, role, dead time
show ip ospf databaseLSAs by type; identical in every router of an area
show ip route ospfO, O IA, O E1/E2 routes with [110/cost]
clear ip ospf processRestart OSPF (new router ID, forced election). Drops every adjacency.
debug ip ospf adj / helloWhy adjacencies fail: mismatches, MTU, authentication

Route codes

CodeMeaning
OIntra-area: from type 1 and 2 LSAs in the router's own area
O IAInter-area: from a type 3 LSA created by an ABR
O E2External, metric fixed (default for redistributed and default routes)
O E1External, internal cost to the ASBR added
O*E2External default route (candidate default)