100 OSPF Interview Questions And Answers

Open Shortest Path First (OSPF) is one of the most widely used interior gateway protocols for routing in IP networks. Having a strong grasp of OSPF is essential for any network engineer working with enterprise networks.

This comprehensive guide covers 100 OSPF interview questions and answers to help you prepare for technical interviews and exams.

100 OSPF Interview Questions and Answers

Let’s start with the basics.

1. What is OSPF?

OSPF (Open Shortest Path First) is a link-state interior gateway routing protocol used for routing in IP networks. OSPF builds a topological map of the network and calculates the shortest path to each destination based on the cost assigned to each link.

2. How does OSPF work?

OSPF works by establishing neighbor adjacencies, exchanging link-states, building a topological database, calculating the shortest path tree, and updating routing tables. The basic steps are:

  • Neighbor discovery using Hello protocol
  • Database synchronization using Database Description packets
  • Flooding link-state advertisements (LSAs)
  • Shortest Path Tree calculation using Dijkstra’s algorithm
  • Routing table update

3. What are the key features of OSPF?

  • Uses link-state routing algorithm (Dijkstra’s algorithm)
  • Supports VLSM and CIDR
  • Hierarchical network design using Areas
  • Multipath load balancing
  • Authentication for security
  • Quick convergence

4. What are the different types of OSPF routers?

There are four types of OSPF routers:

  • Internal router (within an area)
  • Area border router (ABR) (router connected between areas)
  • Backbone router (within backbone area)
  • Autonomous System Boundary Router (ASBR) (redistributes routes from other protocols)

5. What are the different OSPF packet types?

OSPF uses five packet types for neighbor discovery and database synchronization:

  • Hello – Establishes and maintains neighbor relationships
  • Database Description (DBD) – Describes database contents
  • Link State Request (LSR) – Requests updated LSAs
  • Link State Update (LSU) – Sends updated LSAs
  • Link State Acknowledgment (LSAck) – Confirms LSA receipt

6. What is the OSPF backbone area?

The OSPF backbone area (area 0) forms the core of the OSPF network. All other areas must connect to the backbone directly or through a virtual link. The backbone receives and distributes routing information between areas.

7. What are OSPF stub areas?

Stub areas in OSPF do not receive external LSAs or ASBR summaries. Stub areas reduce the size of the topological database by blocking external routes. There are three types of stub areas:

  • Stub – No external LSAs, may have default route
  • Totally stubby – No external or summary LSAs, default route only
  • Not-so-stubby (NSSA) – Can import external routes but not flood externally

8. What is the difference between OSPF and EIGRP?

OSPFEIGRP
Link-state protocolAdvanced distance-vector protocol
Metric – costMetric – bandwidth, delay, etc
Multicast updatesUnicast updates
Manual summarizationAuto summarization
Areas and backboneNo hierarchy
AD – 110AD – 90

9. What is the default administrative distance of OSPF?

The default administrative distance of OSPF is 110.

10. Is OSPF a classful or classless routing protocol?

OSPF is a classless routing protocol that supports VLSM and CIDR. OSPF routers send subnet mask information in their LSAs.

11. How is neighbor discovery performed in OSPF?

OSPF routers discover neighbors and form adjacencies using the Hello protocol. Hello packets are sent to the multicast address 224.0.0.5 every 10 seconds on multiaccess networks and 30 seconds for point-to-point links.

12. What information is included in OSPF Hello packets?

OSPF Hello packets include:

  • Network mask
  • Hello interval
  • Router priority
  • Router dead interval
  • Designated router
  • Backup designated router
  • Neighbor router ID

13. What are the different neighbor states in OSPF?

OSPF routers transition through the following neighbor states:

  • Down – No Hello
  • Init – Hello received but not 2-way
  • 2-way – Bidirectional communication
  • ExStart – Elect designated router
  • Exchange – Synchronize databases
  • Loading – Exchange LSRs and LSAs
  • Full – Neighbor adjacency complete

14. What is the role of designated router in OSPF?

The designated router (DR) establishes adjacencies with all other routers on a multiaccess network and is responsible for generating network LSAs and flooding LSAs over the segment.

15. When is a backup designated router (BDR) elected?

A backup designated router (BDR) is elected as a backup for the DR on multiaccess networks like Ethernet. The BDR prevents adjacency reset if the DR goes down.

16. How are OSPF adjacencies formed?

After reaching the 2-way state, OSPF routers form adjacencies through database description, database synchronization, and link-state flooding processes. LSAs are requested and acknowledged until the link-state databases are fully synchronized.

17. How are link-state advertisements (LSAs) flooded in OSPF?

When an OSPF router detects a topology change, it floods updated LSAs only to its adjacent neighbors. Each router acknowledges the LSA and propagates it to its neighbors until all routers have the same topological database.

18. What sequence of steps lead to OSPF convergence?

The steps leading to OSPF convergence are:

  1. Detect topology change
  2. Generate and flood new LSAs
  3. SPF calculation
  4. Build routing table
  5. Update forwarding table

Proper area design and tuning SPF timers allows OSPF to converge quickly.

19. What is the shortest path first (SPF) algorithm?

SPF (Dijkstra’s algorithm) is used by OSPF to calculate the shortest path tree from source to all destinations. It finds the shortest path based on cumulative cost to reach each node. SPF is run whenever the routing table needs updated.

20. What are the different OSPF network types?

OSPF defines the following network types:

  • Point-to-point
  • Multiaccess (Ethernet)
  • Broadcast
  • Non-broadcast multiaccess (NBMA)
  • Point-to-multipoint

Network type determines OSPF behavior for DR election, hello intervals, and neighbor discovery.

21. What information is contained in OSPF Hello packets?

OSPF Hello packets include:

  • Network mask
  • Hello interval
  • Router priority
  • Router dead interval
  • Designated router
  • Backup designated router
  • Neighbor router ID

Hellos are used for neighbor discovery/maintenance.

22. What do OSPF Database Description packets contain?

Database Description (DBD) packets contain:

  • Router ID of source
  • Area ID
  • Sequence number
  • LSA headers of database
  • Any recent LSA changes

DBDs are used to describe database contents during exchange.

23. When are OSPF Link State Request packets sent?

Link State Request (LSR) packets are sent during database synchronization to request updated LSAs that are discovered to be outdated or missing. LSRs request specific LSAs based on sequence number.

24. What information is flooded in OSPF Link State Update packets?

Link State Update (LSU) packets contain updated LSAs that are flooded during database synchronization to provide missing or updated link-states to neighbors. LSUs contain new instances of LSAs.

25. What is the purpose of OSPF Link State Acknowledgment packets?

Link State Acknowledgment (LSAck) packets confirm receipt of an LSA to the flooding neighbor. LSAcks prevent retransmission of duplicate LSAs.

26. What are the different types of OSPF LSAs?

The types of OSPF LSAs are:

  • Router LSA – Generated by each router
  • Network LSA – Generated by DR for each multiaccess network
  • Summary LSA – Generated by ABRs to summarize inter-area routes
  • ASBR Summary LSA – Generated by ABRs to describe ASBRs
  • External LSA – Generated by ASBRs to advertise external routes
  • Opaque LSA – Used for traffic engineering or carrying application data

27. What information is contained in OSPF router LSAs?

OSPF router LSAs describe the state and cost of router interfaces within an area. Router LSAs contain:

  • Router ID
  • Neighboring router IDs
  • Interface IP addresses
  • Interface subnet masks
  • Interface cost
  • Other flags/options

28. When are OSPF network LSAs generated?

OSPF network LSAs are generated by the designated router (DR) on multiaccess networks, such as Ethernet. Network LSAs identify all attached routers on the segment.

29. What information do OSPF summary LSAs contain?

Summary LSAs are generated by Area Border Routers (ABRs) to advertise destination networks from other areas. Summary LSAs contain:

  • Network number
  • Network mask
  • Cost to destination
  • Advertising ABR router ID

30. What is the purpose of OSPF ASBR summary LSAs?

ASBR summary LSAs are generated by ABRs to advertise the existence of ASBRs in the area. ASBR summary LSAs contain the router ID of the ASBR being described.

31. What information is included in OSPF external LSAs?

External LSAs are originated by ASBRs to advertise external routes redistributed into OSPF. External LSAs include:

  • Network number
  • Network mask
  • Cost
  • Type (E1 or E2)
  • Forwarding address
  • External route tag

32. When are OSPF opaque LSAs used?

Opaque LSAs provide a generalized mechanism to carry application-specific information within OSPF. Opaque LSAs are identified by their Opaque type and Opaque ID field.

33. What is an OSPF area?

OSPF areas allow dividing an OSPF network into smaller subdomains. Areas reduce the OSPF database size by limiting flooding and aggregation. All areas must connect to the backbone area.

34. What is the function of an OSPF ABR?

OSPF Area Border Routers (ABRs) connect the backbone area to regular areas. ABRs condense routing information and summarize routes between areas. ABRs flood LSAs between the backbone and attached areas.

35. What is a stub area in OSPF?

A stub area does not receive external LSAs or ASBR summaries. Stub areas rely on a default route for external traffic, reducing database size.

36. What are the properties of an OSPF totally stubby area?

A totally stubby area only allows a default summary LSA from the ABR. No external or inter-area routes are allowed, reducing the LSDB significantly.

37. What is an OSPF not-so-stubby area (NSSA)?

A NSSA can import external routes and send them to the backbone as a type 7 LSA. Type 7 LSAs are converted to type 5 at the ABR to prevent flooding to entire OSPF domain.

38. What is the difference between NSSA and totally stubby area?

A NSSA can import external LSAs as type 7s, while totally stubby areas block all external routes and allow only a default route. NSSA ABRs convert type 7 to 5.

39. What is an OSPF virtual link?

A virtual link connects an area lacking a physical connection to the backbone through a transit area. Virtual links are configured between ABRs across the transit area.

40. When is an OSPF virtual link required?

A virtual link is required when an area does not have a direct physical connection to the OSPF backbone area. This provides a logical path to the backbone.

41. How is the OSPF router ID determined?

The OSPF router ID is manually configured using the router-id command. If not set, the highest IP address on a loopback interface is automatically selected as the router ID.

42. How are OSPF networks specified?

OSPF networks are defined with the network command, which identifies interfaces on which to enable OSPF. Interfaces can be specified individually or by network.

Here is the continuation of the OSPF interview questions:

43. How are OSPF areas configured?

OSPF areas are configured under the router ospf process using the area command. The area type can be specified as normal, stub, totally stubby, or nssa. Networks are assigned to areas with the area command.

44. How is the OSPF router priority set?

The OSPF router priority is configured with the ip ospf priority command. The router with the highest priority becomes the designated router (DR) on a multiaccess network. Default priority is 1.

45. How is interface cost configured in OSPF?

OSPF interface cost can be explicitly configured using the ip ospf cost command. The cost represents the overhead required to send traffic across the link. Higher cost links are less preferred.

46. How is OSPF authentication configured?

OSPF authentication is configured on a per-interface basis using the ip ospf authentication command. Options include null, simple password, and MD5 authentication.

47. How are routes redistributed into OSPF?

Routes are redistributed into OSPF using the redistribute command under router ospf mode. A route map can filter routes and set metrics. The subnets keyword redistributes subnets.

48. How is route summarization performed in OSPF?

Manual route summarization is configured with the area range command on OSPF ABRs to summarize inter-area routes. The summary-address command summarizes external routes on ASBRs.

49. How is a default route configured in OSPF?

A default route is injected into OSPF as a type 5 external LSA using the default-information originate command on the ASBR. Metrics and route maps can set properties.

50. How do you troubleshoot OSPF neighbor adjacency issues?

  • Verify interface network types and hello/dead intervals match
  • Check for interface authentication mismatches
  • Ensure no duplicate router IDs or network addresses
  • Check for MTU mismatches or L2 problems
  • Verify cabling and interface status

Interview Questions on OSPF Show Commands

51. How do you verify OSPF neighbor adjacency?

The show ip ospf neighbor command displays OSPF neighbor adjacencies, including router ID, state, dead timer, and address.

52. What does the show ip ospf database command display?

The show ip ospf database command displays the OSPF link-state database, including LSAs, sequence numbers, checksums, and aging information.

53. What are useful options for the show ip ospf database command?

Useful options include:

  • internal – Displays only internal LSAs
  • external – Displays only external LSAs
  • network – Displays only network LSAs
  • summary – Displays only summary LSAs
  • router – Displays only router LSAs

54. What does the show ip ospf interface command display?

The show ip ospf interface command displays OSPF information for interfaces, including area, cost, state, neighbor details, authentication, and network type.

55. What does the show ip route ospf command display?

The show ip route ospf command displays the OSPF portion of the routing table, including intra-area, inter-area, and external routes learned via OSPF.

56. What does the show ip ospf topology command show?

The show ip ospf topology command displays the OSPF topology table, including the shortest path tree calculated by the SPF algorithm for each area.

57. What information is included in the show ip protocols command?

The show ip protocols command displays a summary of routing protocol information, including OSPF router ID, area and network assignments, authentication, redistribution, and interfaces.

58. How can you determine if OSPF is enabled on an interface?

The show ip ospf interface command displays OSPF-specific information about interfaces on which OSPF is enabled. The show ip protocols command also displays OSPF enabled interfaces.

59. What command verifies OSPF LSA flooding?

The show ip ospf database command displays OSPF LSAs and their age, which indicates if they are being refreshed by flooding. LSAs with long age may indicate issues.

60. How do you determine the OSPF designated router?

The show ip ospf neighbor detail command displays the designated router and backup designated router for multiaccess networks. The DR and BDR are elected based on priority.

Interview Questions on OSPF Troubleshooting

61. How do you troubleshoot OSPF neighbor stuck in ExStart/Exchange state?

  • Verify area ID, authentication, MTU, and subnet masks match
  • Check for duplicate router ID
  • Clear adjacencies with clear ip ospf process

62. What causes OSPF neighbors stuck in 2-Way state?

  • Interface network types mismatch
  • Hello/dead interval mismatch
  • Missing or incorrect OSPF network commands
  • Problems reaching multicast 224.0.0.5

63. What causes OSPF LSA flooding issues?

  • Network congestion dropping LSAcks
  • Maxaged LSAs from restart/instability
  • Buggy LSA checksum causing retransmissions
  • Authentication failures between neighbors

64. What are some reasons an OSPF route is not appearing in routing table?

  • Route filtering with distribute-list
  • Route not inserted in OSPF with redistribute
  • Higher cost route already in table
  • Administrative distance preventing install
  • Summarization blocking specific subnet

65. How do you troubleshoot OSPF authentication failures?

  • Verify area authentication configuration
  • Check ip ospf authentication command on interfaces
  • Confirm keys match on neighbors
  • Debug crypto packets on interface
  • Analyze OSPF packet dumps

66. What causes OSPF routing flapping?

Frequent OSPF recalculations cause routing flapping. Potential causes include:

  • Network instability triggering LSAs
  • CPU hogging SPF calculations
  • Redistribution churning routes
  • Tuning timers too fast for convergence

67. How do you optimize OSPF convergence time?

  • Tune SPF and LSA timers based on topology
  • Utilize fast hellos for rapid failure detection
  • Implement BFD for link failure detection
  • Enable OSPF fast reroute if supported
  • Minimize instability with tuning parameters

68. What is the difference between OSPF cost and metric?

Metric” is a broader term used for any kind of value that a routing protocol uses to determine the optimal path to a destination, “cost” is the specific form of metric that OSPF uses, calculated based on the bandwidth of the links.

69. How does OSPF elect the DR/BDR on multiaccess networks?

OSPF elects the DR and BDR based on the router priority value. If tied, the router with the highest router ID wins. Default priority is 1.

70. Can you have multiple OSPF processes on a router?

Yes, multiple OSPF processes can be configured using multiple OSPF process IDs. The processes operate independently with separate SPF, LSDB, and adjacencies.

71. Is it possible to load balance traffic across multiple OSPF paths?

Yes, OSPF supports equal-cost multipath (ECMP) which allows load balancing traffic across up to four paths of equal cost to the same destination.

72. Can you summarize routes between OSPF areas?

Yes, OSPF ABRs can summarize routes between areas with the area range command. This condenses the LSDBs and reduces route computations.

73. What is the maximum number of paths supported by OSPF ECMP?

OSPF can support a maximum of four equal cost paths to the same destination network. Traffic is load balanced across the paths.

74. What is the default reference bandwidth for OSPF cost calculation?

The default auto-cost reference bandwidth is 100 Mbps. Link costs are calculated based on this reference value if not explicitly configured.

75. Can you have a separate area solely for a loopback interface?

Yes, a best practice is to place loopbacks in a separate “stub” area to prevent flooding external LSAs over the loopback. This protects the router ID.

76. What is the default SPF timer in OSPF?

The default SPF timer is 5 seconds. This sets the delay between receiving a topology change and starting the SPF calculation.

77. What is the function of OSPF opaque LSAs?

Opaque LSAs provide a generalized mechanism to carry application-specific information within OSPF. Opaque LSAs are identified by their Opaque type and ID field.

78. What is the default LSA flood pacing timer?

The default LSA flood pacing timer is 33 milliseconds. This rate limits how fast LSAs can be sent to neighbors to prevent flooding over slow links.

79. How many LSAs can be contained in a single OSPF LSU packet?

A single OSPF LSU packet can contain up to 1000 LSAs in its payload. This reduces overhead compared to sending individual LSAs.

80. What is the default dead interval in OSPF?

The default OSPF dead interval is 40 seconds. If no hello is received from a neighbor within the dead interval, the neighbor is declared down.

81. What is the function of OSPF sham links?

Sham links are configured between OSPF backbone routers to establish adjacency over a non-backbone area, treating them as a point-to-point link.

82. Can you have overlapping IP addressing with OSPF?

Yes, OSPF supports overlapping IP addresses using the ip ospf network point-to-point command. This eliminates DR election and broadcast flooding.

83. How does OSPF support VLSM and discontiguous networks?

OSPF is classless – it carries subnet mask information in LSAs and supports discontiguous networks. This enables support for VLSM and CIDR.

84. Can you filter routes in OSPF using a distribute-list?

Yes, distribute-lists can be applied in or out of an OSPF routing process to filter which routes are allowed. This controls route exchange and adoption.

85. What is the maximum number of routers supported in an OSPF area?

The theoretical limit is 10,000 routers per area, although the practical limit is lower. Performance and convergence suffer with large topology sizes.

86. What is the function of OSPF link-local signaling (LLS)?

LLS provides a simple acknowledgment mechanism used between neighbors, such as for confirming adjacency reset messages. It uses OSPF packet encapsulation.

87. What is the default timer for OSPF LLS block flooding?

The default LLS extended options block flooding timer is 5 seconds. LLS data blocks are used to multicast flood local signaling information.

88. What is the default minimum LSA arrival timer?

The default LSA minimum arrival timer is 1000 milliseconds. This is the minimum delay between accepting the same LSA from neighbors.

89. What is the default minimum LSA interval?

The default LSA minimum interval is 5000 milliseconds. This is the delay between originating the same LSA.

90. What is the default LSA retransmission interval?

The default LSA retransmission interval is 5 seconds. This is the time between LSA retransmissions if not acknowledged.

91. What is the default OSPF hello interval?

The default OSPF hello interval is 10 seconds for multiaccess networks and 30 seconds for point-to-point. Hellos discover/maintain neighbors.

92. What is the default OSPF dead interval?

The default dead interval is 4 times the hello interval, or 40 seconds. The dead interval dictates when a silent neighbor is declared down.

93. What is the default OSPF grace period?

The default OSPF grace period is 40 seconds. This provides time for neighbors to reconnect after a reload before declaring the adjacency down.

94. Can you have different OSPF cost metrics per interface?

Yes, OSPF allows configuring the cost metric explicitly per interface with the ip ospf cost command. By default, cost is calculated based on bandwidth.

95. What is the default administrative distance of OSPF external routes?

The default admin distance of OSPF external routes is 110. OSPF internal routes have an AD of 110, while external routes have an AD of 110 by default.

96. What is the difference between OSPF stub areas and totally stubby areas?

Stub areas block external LSAs, while totally stubby areas block external and summary LSAs. Totally stubby areas rely solely on a default route.

97. What is the default OSPF E2 external route metric?

The default OSPF E2 external route metric is 20. This cost can be modified by changing the default-metric command when redistributing routes into OSPF.

Here is the continuation of the OSPF interview questions:

98. What is the default reference bandwidth for OSPF?

The default auto-cost reference bandwidth used by OSPF is 100 Mbps. Link costs are calculated based on this reference value if not explicitly configured.

99. Can you filter routes advertised between OSPF areas?

Yes, you can filter routes advertised between OSPF areas by configuring an ACL on the ABR and applying it to the area range command. This selectively filters summarized routes.

100. How does OSPF support unequal cost load balancing?

OSPF supports up to four unequal cost paths to the same destination by default. Traffic is distributed inversely proportional to the cost ratios of the paths.

Additional OSPF Interview Questions for your Preparations

  • Explain the difference between OSPF broadcast and non-broadcast multiaccess networks.
  • What is the maximum number of routers supported on an OSPF broadcast network?
  • How do you troubleshoot OSPF virtual link issues?
  • What are some common causes of OSPF neighbor flapping?
  • What tools can be used to analyze OSPF LSAs and neighbor state?
  • How does OSPF support traffic engineering?
  • What is the effect of the OSPF subnets command?
  • What are the different OSPF router roles?
  • How are OSPF LSAs aged and refreshed?
  • What are the different OSPF LSA types and their purpose?
  • Explain the election process for OSPF designated and backup routers.
  • How can you optimize OSPF convergence times?
  • What is the difference between OSPF stub, totally stubby, and NSSA areas?
  • What are the advantages of using OSPF over distance vector protocols?
  • What is the maximum OSPF path metric?
  • What is the function of OSPF hello and dead timers?
  • How does OSPF determine the DR/BDR on a multiaccess network?

Leave a Reply

Your email address will not be published. Required fields are marked *