OSPF Protocol: Complete Guide
Open Shortest Path First (OSPF) is a link-state routing protocol used in enterprise networks. This guide covers OSPF concepts, areas, LSAs, configuration, neighbor states, and troubleshooting with practical examples.
How to Study OSPF Using This Lab and Troubleshooting Hub
This OSPF lab hub gives you a simple study path for learning Open Shortest Path First routing. Use the OSPF labs index as a compact table of contents for every lesson. OSPF is a link-state routing protocol used in enterprise networks, and it is an important topic for CCNA, CCNP ENARSI, and real troubleshooting work.
Start with the basics: how OSPF routers discover neighbors, exchange Hello packets, build the link-state database, and calculate the best path using SPF. After that, move into areas, LSAs, DR/BDR election, route types, authentication, route filtering, and OSPFv3 for IPv6.
Do not learn OSPF as commands only. In a real lab, you should be able to explain why a neighbor is stuck, why a route is missing, which LSA carried the route, and why OSPF selected one path instead of another.
Recommended OSPF Learning Path
- Begin with the OSPF overview to understand router IDs, Hello packets, LSAs, the LSDB, and SPF calculation.
- Study OSPF areas and LSA types so you understand how OSPF controls route flooding.
- Practice OSPF configuration with network statements, passive interfaces, router IDs, interface cost, and verification commands.
- Review OSPF neighbor states and DR/BDR election before troubleshooting adjacency issues.
- Move into stub areas, route filtering, virtual links, authentication, and OSPFv3.
Before You Start an OSPF Lab
Before configuring OSPF, write down the expected design. Note the area numbers, router IDs, interface IP addresses, OSPF-enabled links, passive interfaces, expected neighbors, DR/BDR roles, interface costs, and expected routes.
This small baseline makes troubleshooting much easier because you can compare the actual router output with the expected design.
What to Verify in Every OSPF Lab
A successful ping is useful, but it does not prove that OSPF is correct. Always verify the neighbor table, OSPF interface settings, LSDB, and routing table.
- Use
show ip ospf neighborto confirm neighbor state. - Use
show ip ospf interfaceto check area ID, timers, network type, cost, priority, authentication, and DR/BDR status. - Use
show ip ospf databaseto confirm that the expected LSAs exist. - Use
show ip route ospfto confirm that OSPF routes are installed in the routing table. - Use
show ip ospfto check router ID, area information, SPF activity, and reference bandwidth.
Common OSPF Troubleshooting Checks
If an OSPF neighbor does not form, compare the area ID, subnet mask, Hello and dead timers, authentication, network type, MTU, stub-area setting, router ID, and interface status on both routers.
If a neighbor is stuck in 2-Way, remember that this can be normal between two DROTHER routers on a broadcast segment. On a point-to-point link, however, it usually needs investigation.
If a neighbor is stuck in ExStart or Exchange, check MTU mismatch, duplicate router IDs, packet loss, ACLs, interface errors, and network-type mismatch.
If an OSPF route is missing, first check the LSDB. If the LSA is missing, focus on advertisement or flooding. If the LSA exists but the route is not installed, check next-hop reachability, route filtering, SPF calculation, administrative distance, or a better route from another protocol.
OSPF Lab Practice
Build a simple three-router topology and configure single-area OSPF. Confirm that all expected adjacencies form and that remote networks appear as OSPF routes.
After the lab works, introduce one fault at a time. Try mismatched timers, different area IDs, duplicate router IDs, MTU mismatch, a passive interface, wrong network statement, changed interface cost, route filtering, and authentication mismatch.
For each fault, compare the neighbor table, OSPF interface output, LSDB, logs, and routing table. This turns OSPF from a memorized topic into a troubleshooting skill.
Compare OSPF with EIGRP, RIP, and BGP
After completing the OSPF labs, test the same topology using EIGRP or RIP. Comparing identical failures across different routing protocols makes it easier to understand link-state versus distance-vector behavior, neighbor formation, routing metrics, update mechanisms, convergence speed, loop prevention, summarization, and route installation.
BGP should be studied separately as a path-vector protocol designed primarily for policy-based routing between autonomous systems.
Related OSPF Practice and Networking Tools
- Complete OSPF Labs and Study Path Index
- OSPF for CCNP ENARSI Technical Guide
- OSPF Configuration and Troubleshooting Labs
- Routing Practice Test for OSPF, BGP, EIGRP, RIP, metrics and path selection.
- Subnet Calculator to confirm network ranges before adding OSPF network statements.
- Wildcard Mask Calculator to generate wildcard masks for OSPF configuration.
- EIGRP Labs, RIP Labs, and BGP Labs for routing protocol comparison.
- IPv6 and OSPFv3 Configuration Guide
- IP Location Finder for public address, ASN and provider context.
- Cisco NAT Configuration Guide for translating lab networks at an internet edge.
OSPF Lab Frequently Asked Questions
What should I learn first in OSPF?
Start with neighbor discovery, router IDs, Hello packets, LSAs, the LSDB, and SPF calculation. Then move into areas, route types, DR/BDR election, configuration, and troubleshooting.
Which OSPF topics are important for CCNP ENARSI?
Focus on neighbor states, router ID selection, network types, DR/BDR election, interface cost, reference bandwidth, LSA types, multi-area OSPF, stub areas, NSSA, summarization, filtering, authentication, virtual links, OSPFv3, redistribution, and troubleshooting.
Why is my OSPF neighbor not reaching Full state?
On broadcast networks, DROTHER routers normally stay in 2-Way with each other. On point-to-point links, or between a router and the DR/BDR, failure to reach Full usually points to timer mismatch, authentication mismatch, MTU mismatch, duplicate router IDs, packet loss, network-type mismatch, or area issues.
What is the difference between the LSDB and routing table?
The LSDB stores OSPF topology information learned through LSAs. The routing table contains only the routes selected and installed for packet forwarding. That means an LSA can exist in the LSDB even when the related route is not installed.