Interview prep · 8 questions
Routing and OSPF interview questions
What do interviewers test with routing questions?
They test how a router chooses a path: longest prefix match first, then how much it trusts the route's source, then the protocol's own metric. Expect OSPF neighbour troubleshooting and gateway redundancy too, because both come up in any network with more than one router.
Updated
Mock interview
One question at a time. Answer it out loud as you would in the room, then reveal the model answer and rate yourself honestly. Your progress stays in this browser.
How does a router choose between several routes to the same destination?
Mid level
First it picks the most specific match: the route with the longest prefix that contains the destination. Only when two sources offer the same prefix does it compare administrative distance, and within one protocol it compares that protocol's metric.
So a /28 static route beats a /24 learned by OSPF for an address inside the /28, even though OSPF might look like the better source.
When routes tie on all three, a router can install them side by side as equal-cost paths and share the load between them.
Common weak answer: Saying administrative distance is checked first. Prefix length always wins before distance is even considered.
Likely follow-ups
- What is administrative distance?
- What is a floating static route?
- How do you see which route a router would use for one address?
What is administrative distance, and what are the common default values?
Entry level
Administrative distance ranks how much a router trusts each source of routing information when two sources offer the same prefix, and lower wins. Common defaults are 0 for connected, 1 for static, 20 for external BGP, 90 for EIGRP, 110 for OSPF, 120 for RIP and 200 for internal BGP.
Distance is local to the router and never advertised to neighbours. You can change it per route, which is how a floating static route works: a static route with a distance higher than the dynamic protocol's stays out of the table until the dynamic route disappears.
The exact numbers vary between platforms, so knowing that the comparison happens only between equal prefixes matters more than reciting them.
Common weak answer: Mixing up distance and metric. Distance compares different sources; a metric compares paths within one protocol.
Likely follow-ups
- How would you configure a static route that only takes over if OSPF fails?
- Why does a connected route always win?
- Is administrative distance sent to neighbouring routers?
What is a default route, and when would you use one?
Entry level
A default route, 0.0.0.0/0, matches every destination and is used only when nothing more specific does. It is the natural choice for a stub network with one way out, such as a branch that sends everything non-local to headquarters, or an edge router that sends everything to its internet provider.
The other side still needs a specific route back to the branch's subnets. Forgetting the return path is the classic reason a default route seems to work in one direction only.
A routing protocol can hand a default route to every router, so only the edge needs it configured by hand.
Common weak answer: Putting a default route on every router, core included. Two routers that point their defaults at each other create a loop.
Likely follow-ups
- What is the gateway of last resort?
- How would you share a default route through OSPF?
- Why does a branch with a default route still need a route back at headquarters?
When would you choose static routes over a dynamic routing protocol?
Entry level
Static routes suit small or stub networks whose paths rarely change: they cost nothing to run and do exactly what you typed. A dynamic protocol is the better choice once there are several routers or redundant paths, because it learns new networks and routes around failures without anyone editing every router.
Static routes are also a deliberate tool for control, such as a backup path or a route you do not want to depend on a protocol for.
The price of dynamic routing is configuration and troubleshooting effort: neighbours have to form, and a mistake on one router can spread to all of them.
Common weak answer: Calling static routes insecure or outdated. Most networks use both on purpose.
Likely follow-ups
- How does a static route fail over when its next hop goes down?
- What does a dynamic protocol need before it can learn anything?
- How would you combine static and dynamic routing on one edge router?
What must match for two OSPF routers to become neighbours?
Mid level
They must share a subnet on the link and agree on the area ID, the hello and dead timers, the authentication settings and the area type, such as stub. Their router IDs must be unique, and the interface has to be enabled for OSPF and not passive.
An MTU mismatch is the sneaky one: the routers see each other but stop short of FULL, because the database exchange fails.
On a shared Ethernet segment, two routers that are neither the designated router nor the backup stay at 2-WAY with each other. That is normal, not a fault.
Common weak answer: Listing the OSPF process ID. It is local to each router and does not have to match.
Likely follow-ups
- Why does OSPF elect a designated router on an Ethernet segment?
- What does a neighbour stuck in INIT tell you?
- What does a passive interface do?
How does OSPF choose the best path?
Mid level
OSPF adds up the cost of every outgoing interface along each path and installs the path with the lowest total. By default an interface's cost is a reference bandwidth divided by the interface's bandwidth, so faster links cost less.
A longer path of fast links can beat a shorter path over a slow link, which surprises people used to counting hops.
With today's fast links the default reference bandwidth can give a 1 Gbps and a 10 Gbps link the same cost, so many networks raise the reference bandwidth or set costs by hand.
Common weak answer: Saying OSPF picks the path with the fewest routers. That is RIP's metric, not OSPF's.
Likely follow-ups
- How would you steer traffic onto one particular link?
- Why can two very different links end up with the same cost?
- What happens when two paths have an equal cost?
How does EIGRP choose a path, and what stops two EIGRP routers from becoming neighbours?
Mid level
By default EIGRP's metric combines the slowest bandwidth along the path with the total delay, so it prefers fast links over fewer hops. Two routers become neighbours only if they use the same autonomous system number and matching metric weights, and their interfaces share a subnet.
EIGRP keeps a backup path ready when it can prove that path is loop-free (a feasible successor), so it can switch over without recalculating.
An autonomous system mismatch is silent: both routers run happily and learn nothing from each other.
Common weak answer: Saying EIGRP counts hops. Hop count only limits how far its routes travel; it is not the metric.
Likely follow-ups
- What is a feasible successor?
- Why might you change an interface's delay rather than its bandwidth?
- How do you see EIGRP neighbours?
What problem does a first-hop redundancy protocol solve?
Mid level
Hosts send off-subnet traffic to one default gateway address, so if that router fails, every host loses everything beyond its subnet. A first-hop redundancy protocol such as VRRP lets two or more routers share a virtual gateway address, with one active and the others ready to take over.
The active router answers ARP for the virtual address with a virtual MAC address, so when a backup takes over the hosts keep the same gateway and their traffic simply follows.
Priority decides which router is active, and preemption decides whether a recovered router with a higher priority takes the role back.
Common weak answer: Suggesting two default gateways on every host. Most hosts use only one at a time, so that does not give fast failover.
Likely follow-ups
- What does preemption do?
- How do hosts keep working through a failover?
- How would you make sure the router with the working uplink stays active?