Skip to content

Routing and OSPF Interview Questions for CCNA

25 Routing and OSPF questions with answers for ccna roles — 7 easy, 12 medium, 6 hard.

About Routing and OSPF

Routing decides how packets cross networks. This topic covers longest prefix match, administrative distance, static, default and floating routes, distance vector versus link state, and single-area OSPFv2 with neighbour states, router ID, DR and BDR and cost. It also covers HSRP for gateway redundancy and troubleshooting OSPF adjacencies stuck in INIT or EXSTART.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How does a router choose the best route to a destination?

Save to ▾
Show answer
First it uses longest prefix match: the most specific matching prefix wins, so 10.1.1.0/24 beats 10.1.0.0/16. If the same prefix comes from different sources, the lowest administrative distance wins. If the same protocol offers several paths, the lowest metric wins, and equal metrics can be load-balanced with ECMP. Only the winners are installed in the routing table.
02

What are the default administrative distances you should know?

Save to ▾
Show answer
Connected 0, static 1, EIGRP summary 5, eBGP 20, internal EIGRP 90, OSPF 110, IS-IS 115, RIP 120, external EIGRP 170 and iBGP 200. A value of 255 means the route is never used. AD compares trust between sources, so a static route with AD 1 beats OSPF for the same prefix unless you configure a floating static with a higher AD.
03

How is the OSPF router ID chosen?

Save to ▾
Show answer
The router ID is a 32-bit value chosen in this order: manually configured router-id, then the highest IP on an up loopback interface, then the highest IP on an up physical interface. It is chosen when the OSPF process starts, so changes need clear ip ospf process. Best practice is to set it manually so it is stable and easy to recognise in the database.
04

How do you configure IPv4 static and default routes?

Save to ▾
Show answer
Use a next-hop IP, an exit interface, or both. ip route 10.2.0.0 255.255.0.0 192.168.12.2 ip route 0.0.0.0 0.0.0.0 203.0.113.1 ! floating backup with AD 200 ip route 0.0.0.0 0.0.0.0 198.51.100.1 200 ! IPv6 ipv6 route ::/0 2001:db8:12::2 show ip route static
05

Which commands verify OSPF operation?

Save to ▾
Show answer
These commands cover neighbours, interfaces, routes and the database. show ip ospf neighbor show ip ospf interface brief show ip ospf interface Gi0/0 show ip route ospf show ip ospf database show ip protocols show ip protocols shows router ID, networks, passive interfaces and the reference bandwidth.
06

How do you read a line in the IOS routing table?

Save to ▾
Show answer
Example line: O 10.2.2.0/24 [110/20] via 10.0.12.2, 00:05:12, GigabitEthernet0/0 O is the source (OSPF), 10.2.2.0/24 the prefix, 110 the administrative distance and 20 the metric, 10.0.12.2 the next hop, then the age and exit interface. C is connected, L local host route, S static, D EIGRP and an asterisk marks the candidate default.
07

How do you approach working in a 24x7 network operations shift?

Save to ▾
Show answer
Situation: I joined a NOC that ran rotating shifts. Task: stay effective and keep handovers clean. Action: I followed runbooks, kept a shift log of every alert and action, raised early escalations for anything outside my scope and used quiet hours to lab new topics. Result: I handled shift incidents within SLA, earned positive feedback for clear handovers and was moved to the L2 team in a year.
08

What is a floating static route?

Save to ▾
Show answer
A floating static route is a backup static route with a higher administrative distance than the primary route, so it stays out of the routing table until the primary disappears. For example, if OSPF (AD 110) learns the main path, ip route 0.0.0.0 0.0.0.0 203.0.113.1 200 installs only when OSPF loses the route. It is common for backup internet or 4G links.
09

Compare distance vector and link state routing protocols.

Save to ▾
Show answer
Distance vector protocols like RIP share their routing table with neighbours and trust what they hear, so they converge slowly and need loop prevention such as split horizon. Link state protocols like OSPF and IS-IS flood link state advertisements so each router builds a full topology map and runs Dijkstra's SPF algorithm. Link state converges faster and scales better but uses more memory and CPU.
10

How does OSPF form a neighbour adjacency?

Save to ▾
Show answer
Routers send hellos to 224.0.0.5. They become neighbours if area ID, subnet and mask, hello and dead timers, authentication and stub flags match, and the router IDs are unique. States go Down, Init, 2-Way, ExStart, Exchange, Loading and Full. In ExStart and Exchange they agree master and slave and swap database descriptions, which is where an MTU mismatch causes a stuck adjacency.
11

What are DR and BDR in OSPF and why are they needed?

Save to ▾
Show answer
On multi-access networks such as Ethernet, a full mesh of adjacencies would create too many LSAs. OSPF elects a Designated Router and Backup DR; other routers (DROTHERs) form full adjacency only with them and stay 2-Way with each other. The highest interface priority wins, then highest router ID; priority 0 means never DR. Election is non-preemptive, so a new better router does not take over.
12

How is OSPF cost calculated?

Save to ▾
Show answer
Cost equals reference bandwidth divided by interface bandwidth. The default reference is 100 Mbps, so FastEthernet, Gigabit and 10 Gigabit all get cost 1, which hides the faster links. Change it with auto-cost reference-bandwidth 100000 on every router so 1G becomes 100 and 10G becomes 10. You can also set ip ospf cost directly on an interface. Path cost is the sum of outgoing interface costs.
13

Why does OSPF use areas and what is area 0?

Save to ▾
Show answer
Areas limit how far detailed LSAs flood, so SPF runs on a smaller database and changes in one area do not force recalculation everywhere. Area 0 is the backbone and every other area must connect to it, directly or through a virtual link. Routers connecting areas are ABRs and can summarize routes between areas. Single-area OSPF is the focus of CCNA.
14

What are the first hop redundancy protocols and how does HSRP work?

Save to ▾
Show answer
FHRPs give hosts a virtual gateway IP shared by two or more routers. HSRP is proprietary: routers elect an active router by highest priority (default 100), and the standby takes over the virtual IP and MAC if hellos stop. Preempt lets a higher priority router reclaim the role. VRRP is the open standard, and GLBP adds load sharing across several routers.
15

Two OSPF routers are directly connected but show no neighbour at all. How do you troubleshoot?

Save to ▾
Show answer
I check that the interfaces are up and in the same subnet, then show ip ospf interface to compare area, hello and dead timers, network type and authentication. I make sure the interface is not passive and that the network statement or ip ospf area command covers it. Finally I check that no ACL blocks protocol 89 or multicast 224.0.0.5, and use debug ip ospf adj if needed.
16

How do you configure single-area OSPFv2?

Save to ▾
Show answer
Set a router ID, enable OSPF on interfaces and make user ports passive. router ospf 1 router-id 1.1.1.1 auto-cost reference-bandwidth 100000 passive-interface GigabitEthernet0/1 network 10.0.12.0 0.0.0.3 area 0 network 192.168.1.0 0.0.0.255 area 0 default-information originate Or per interface: ip ospf 1 area 0
17

How do you configure HSRP for a VLAN gateway?

Save to ▾
Show answer
Configure the same group and virtual IP on both switches, with higher priority on the active one. interface vlan 10 ip address 192.168.10.2 255.255.255.0 standby version 2 standby 10 ip 192.168.10.1 standby 10 priority 110 standby 10 preempt show standby brief Hosts use 192.168.10.1 as their gateway.
18

Describe a situation where you had to explain a technical issue to a non-technical manager.

Save to ▾
Show answer
Situation: a routing loop during a carrier change caused a two-hour outage and the operations head wanted an explanation. Task: explain cause and prevention simply. Action: I used a road map analogy, explained that two routers kept sending traffic to each other, showed the timeline and our fix, and listed three prevention steps with dates. Result: management approved a proper change review board, and trust in our team improved.
19

Describe a time you disagreed with a senior engineer about a network design. How did you handle it?

Save to ▾
Show answer
Situation: a senior engineer wanted static routes for twelve new branches. Task: I believed OSPF would scale better. Action: instead of arguing in the meeting, I built both options in a lab, measured failover time and listed the change effort for each. I shared the results privately first. Result: we agreed on OSPF with summarization at the hub, and he asked me to write the standard. I learned that data persuades better than opinions.
20

Two OSPF routers on the same link are stuck in EXSTART state. What is the cause and fix?

Save to ▾
Show answer
EXSTART or EXCHANGE stuck usually means an MTU mismatch, because database description packets larger than the neighbour's MTU are dropped. I compare MTU with show interfaces and set ip mtu to match on both sides. As a temporary workaround, ip ospf mtu-ignore can be used, but fixing the MTU is better. Duplicate router IDs can also cause odd adjacency behaviour, so I check those too.
21

A route you expect from OSPF is in the OSPF database but not in the routing table. Why?

Save to ▾
Show answer
Another source with a lower AD may be providing the same prefix, such as a static route, so the OSPF route is not installed. Or a more specific route wins by longest match. The next hop may also be unreachable, or a distribute-list may filter it. I check show ip route for the prefix, show ip ospf database, and compare administrative distances.
22

A branch has a primary MPLS link with OSPF and a backup broadband link. How do you design failover?

Save to ▾
Show answer
Run OSPF over MPLS for the primary path. For the backup, use a floating static default route via the broadband link with AD higher than OSPF, for example 250, or run an IPsec tunnel with OSPF at a higher cost. Track the primary with IP SLA if the provider does not drop the link on failure, so the backup activates even when the interface stays up.
23

Traffic is not load balancing across two equal links even though both are in OSPF. What do you check?

Save to ▾
Show answer
Both paths must have equal total cost to be installed as ECMP. I check show ip route for two next hops. If only one shows, I compare interface costs, which differ if bandwidth or the reference bandwidth differs. I also check maximum-paths. Even with ECMP, load sharing is per flow using CEF, so a single large flow uses one link only.
24

How do you change OSPF DR election on a segment?

Save to ▾
Show answer
Set interface priority; higher wins and 0 never becomes DR. interface GigabitEthernet0/0 ip ospf priority 255 ! on a router that should never be DR interface GigabitEthernet0/0 ip ospf priority 0 clear ip ospf process Because election is non-preemptive, reset the process or the neighbours for the change to take effect.
25

After adding a second internet router, some sessions break at the stateful firewall because return traffic uses the other exit. How do you fix it?

Save to ▾
Show answer
This is asymmetric routing: the firewall sees only one direction of the flow and drops it. Make the path symmetric by using one active exit per prefix, for example HSRP or a higher OSPF default-route cost on the backup, and advertise inbound routes consistently with the same preference. If both links must be active, pair the firewalls with state sharing or use NAT per exit so return traffic comes back to the router that sent it.

Frequently asked questions

How important is Routing and OSPF in CCNA interviews?

Routing decides how packets cross networks. This topic covers longest prefix match, administrative distance, static, default and floating routes, distance vector versus link state, and single-area OSPFv2 with neighbour states, router ID, DR and BDR and cost. It also covers HSRP for gateway redundancy and troubleshooting OSPF adjacencies stuck in INIT or EXSTART.

How should I use the Routing and OSPF sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.