CCNA 200-301Chapter 123 of 260Objective 3.4

Troubleshoot: OSPF Choosing Wrong Path

When OSPF chooses a suboptimal path, your network suffers from degraded performance, increased latency, and frustrated users. On the CCNA 200-301 exam, objective 3.4 requires you to troubleshoot OSPF path selection issues—a skill that separates competent engineers from rookies. In real networks, a wrong OSPF path can silently cripple traffic for months before someone notices. This chapter gives you the systematic approach to identify why OSPF picks the 'wrong' path and how to fix it.

25 min read
Advanced
Updated May 31, 2026

The GPS That Takes You Through Traffic

Imagine you're driving from home to work, and your GPS gives you two routes: Route A is a 10-mile highway that usually takes 15 minutes, but today there's a major accident causing a 30-minute delay. Route B is a 12-mile backroad that normally takes 20 minutes, but it's clear. A smart GPS would recalculate and send you via Route B because it's faster. But OSPF isn't a smart GPS—it's more like a GPS that only looks at distance (metric) and ignores real-time traffic (load, delay, reliability). In OSPF, the 'distance' is cost, calculated from bandwidth (cost = 100 Mbps / interface bandwidth). So if you have a Gigabit Ethernet link (cost 1) and a 100 Mbps link (cost 1), OSPF sees them as equal cost, even if the Gigabit link is congested. Worse, if you have a 1 Gbps link (cost 1) and a 10 Gbps link (cost 1), OSPF still sees them as equal because cost is an integer and both round to 1. The GPS analogy breaks down because OSPF doesn't have a 'traffic' sensor—it only knows the road's speed limit, not the actual congestion. So when a network engineer says 'OSPF chose the wrong path,' they mean OSPF selected a route that, based on real-world conditions, is slower or less reliable than an alternative. This happens because OSPF's metric is static and based solely on interface bandwidth, not dynamic factors. The fix often involves manipulating the cost manually or adjusting reference bandwidth to differentiate high-speed links.

How It Actually Works

What Is a 'Wrong Path' in OSPF?

In OSPF, every router calculates the shortest path to every destination using the SPF algorithm (Dijkstra). The metric is cost, which is inversely proportional to bandwidth: cost = reference-bandwidth / interface-bandwidth. By default, the reference bandwidth is 100 Mbps (Cisco's old standard). So a FastEthernet (100 Mbps) link has cost 1, a GigabitEthernet (1000 Mbps) link also has cost 1 (since 100/1000 = 0.1, rounded to 1), and a 10 Gbps link also gets cost 1. This means OSPF cannot distinguish between 100 Mbps, 1 Gbps, and 10 Gbps links—they all appear equal cost. That's one major reason OSPF might choose a 'wrong' path: it treats all high-speed links as identical, so it load-balances across them equally, even if one is much faster.

Another common cause is incorrect cost configuration. An engineer might manually set cost on an interface to influence path selection, but if they set it too high or too low, OSPF might prefer a slower link. Also, OSPF considers path type: intra-area (O) routes are preferred over inter-area (O IA) routes, which are preferred over external routes (E1/E2 or N1/N2). So if a router learns a route via an intra-area path with cost 20 and an inter-area path with cost 10, it will choose the intra-area path (cost 20) because intra-area is always preferred, regardless of cost. This is a common exam trap.

How OSPF Path Selection Works Step by Step

1.

Route Type Preference: OSPF first compares the route type. The order of preference (from most to least preferred) is: intra-area (O), inter-area (O IA), external type 1 (E1), external type 2 (E2), NSSA type 1 (N1), NSSA type 2 (N2).

2.

Metric (Cost) Comparison: If the route type is the same, OSPF compares the cost. The route with the lower cost is preferred.

3.

Equal-Cost Load Balancing: If multiple routes have the same route type and same cost, OSPF can load-balance across up to 4 equal-cost paths by default (configurable up to 32 with maximum-paths).

4.

Administrative Distance: OSPF has an administrative distance of 110. If the same prefix is learned from another routing protocol (e.g., EIGRP with AD 90), the protocol with lower AD wins, regardless of OSPF metric.

Key States, Timers, and Defaults

Reference bandwidth: Default 100 Mbps. Use auto-cost reference-bandwidth to change it (e.g., auto-cost reference-bandwidth 1000 for 1 Gbps).

Cost calculation: cost = reference-bandwidth / bandwidth. Bandwidth is the configured bandwidth on the interface (default is actual speed for Ethernet, but can be changed with bandwidth command).

Maximum paths: Default 4. maximum-paths <1-32> under router OSPF.

OSPF network types: Broadcast (default for Ethernet), point-to-point, non-broadcast, point-to-multipoint. Network type affects neighbor discovery and DR/BDR election.

OSPF timers: Hello 10 sec (broadcast, point-to-point), 30 sec (NBMA); Dead 40 sec (broadcast, point-to-point), 120 sec (NBMA).

IOS CLI Verification Commands

To see the OSPF routing table:

show ip route ospf

Example output:

O    10.1.1.0/24 [110/20] via 192.168.1.1, 00:00:05, GigabitEthernet0/1
O IA 10.2.2.0/24 [110/30] via 192.168.2.1, 00:01:00, GigabitEthernet0/2

The [110/20] shows administrative distance (110) and metric (cost 20).

To see OSPF interface details:

show ip ospf interface gigabitEthernet 0/1

Example output:

GigabitEthernet0/1 is up, line protocol is up
  Internet Address 192.168.1.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 192.168.1.1
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.1.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Note the Cost field. If cost is 1 on a Gigabit Ethernet, the reference bandwidth is still 100 Mbps.

To see the LSDB and SPF details:

show ip ospf database
show ip ospf spf detail

How OSPF Interacts with Related Protocols

OSPF interacts with BFD (Bidirectional Forwarding Detection) for fast failure detection. If BFD is configured, OSPF can detect link failures in milliseconds instead of seconds. OSPF also interacts with route redistribution: routes from other protocols (EIGRP, RIP, static) can be redistributed into OSPF as external routes (E1 or E2). The metric type (E1 vs E2) affects path selection: E1 adds the internal cost to the external metric, while E2 only uses the external metric. This can cause suboptimal path selection if not configured carefully.

Common Causes of Wrong Path Selection

1.

Equal-cost paths due to reference bandwidth: Multiple high-speed links all have cost 1, leading to load balancing when one link is much faster.

2.

Manual cost misconfiguration: An interface cost set too low or too high.

3.

Route type preference: Intra-area route preferred over inter-area even if inter-area has lower cost.

4.

Administrative distance conflict: Another protocol with lower AD (e.g., static route AD 1) overrides OSPF.

5.

Incorrect bandwidth setting: The bandwidth command on an interface affects cost; if set incorrectly, cost is wrong.

6.

OSPF network type mismatch: Can cause neighbor issues and incomplete LSDB, leading to missing routes or suboptimal paths.

7.

Redistribution issues: External routes with wrong metric type or metric can cause traffic to take a longer path.

Walk-Through

1

Identify the Suboptimal Path

First, determine which path the router is actually using and which path you expected. Use `show ip route <destination>` on the router that should have the optimal path. Compare the next-hop and interface to your network diagram. For example, if the router is using a 100 Mbps link to reach a server when a 1 Gbps link is available, that's a wrong path. Also check `show ip route ospf` to see all OSPF routes. Note the metric and route type (O, O IA, E1, etc.). If the expected path is not in the routing table, it might not be installed due to higher metric or route type preference.

2

Check OSPF Neighbors and LSDB

Use `show ip ospf neighbor` to verify that OSPF adjacencies are full with all expected routers. If a neighbor is missing or in a state other than FULL (e.g., 2WAY), the LSDB may be incomplete. Then use `show ip ospf database` to see if the destination prefix is present. If the prefix is missing, the router doesn't know about that path. Also check `show ip ospf interface` to see the network type and cost on each interface. If the cost is unexpectedly high or low, that could explain the path choice.

3

Verify Interface Cost and Bandwidth

On the interfaces along the expected path, check the OSPF cost with `show ip ospf interface <interface>`. If the cost is the same on multiple paths, OSPF will load-balance. To differentiate high-speed links, change the reference bandwidth: `router ospf 1` then `auto-cost reference-bandwidth 1000`. This makes Gigabit Ethernet cost 1 (1000/1000) and 100 Mbps cost 10 (1000/100). Alternatively, manually set cost with `ip ospf cost <value>` on an interface. For example, if you want to prefer a 1 Gbps link over a 10 Gbps link, set cost 10 on the 1 Gbps link and cost 1 on the 10 Gbps link.

4

Check Route Type and Administrative Distance

If the expected path has a lower metric but is not installed, check the route type. Use `show ip route <destination>` and look at the first letter: O (intra-area) is preferred over O IA (inter-area). If you have an intra-area route with cost 20 and an inter-area route with cost 10, the intra-area route wins. To fix, you might need to make the inter-area route intra-area by extending area 0 or using virtual links (not recommended). Also check administrative distance: if another protocol (e.g., EIGRP AD 90) is installing the route, OSPF's route won't be used. Use `show ip route <destination>` to see which protocol installed the route.

5

Examine Redistribution and External Routes

If the path involves redistributed routes (E1/E2 or N1/N2), the metric type matters. Use `show ip ospf database external` or `show ip route ospf` to see the metric type. E1 routes add internal cost to the external metric, so they may be preferred over E2 routes with lower external metric if the internal cost is low. For example, an E1 route with external metric 20 and internal cost 5 (total 25) might be worse than an E2 route with external metric 30 (total 30) if the E1 path is longer. To fix, adjust the metric type or metric during redistribution. Use `redistribute eigrp 1 metric-type 1 metric 20` to set E1 with metric 20.

6

Correct the Configuration and Verify

Based on your findings, apply the fix: change reference bandwidth, set manual cost, adjust redistribution, or change administrative distance. Then verify with `show ip route <destination>` and `traceroute <destination>`. Also check `show ip ospf interface` to confirm cost changes. If the path still isn't optimal, repeat the troubleshooting steps. Remember that OSPF recalculates SPF when costs change, but it may take a few seconds. Use `debug ip ospf spf` to see SPF calculations (in a lab, not production). Finally, document the change and ensure the path is now correct.

What This Looks Like on the Job

In a large enterprise with multiple data centers, OSPF is often used as the IGP. A common scenario is a company that has two links to a remote branch: a primary 1 Gbps MPLS circuit and a backup 100 Mbps DSL line. The network engineer expects OSPF to prefer the 1 Gbps link, but due to the default reference bandwidth of 100 Mbps, both links have cost 1 (100/1000 = 0.1 rounded to 1, and 100/100 = 1). OSPF load-balances across both, causing traffic to go over the slow DSL line half the time. The fix is to set auto-cost reference-bandwidth 1000 on all routers, making the 1 Gbps link cost 1 and the 100 Mbps link cost 10. This immediately steers all traffic to the faster link.

Another scenario: an organization uses route redistribution between OSPF and EIGRP. OSPF learns a route as an E2 external route with metric 20, but the actual path through EIGRP has a lower metric. However, because the route is redistributed as E2, OSPF ignores the internal cost and uses the external metric. This can cause traffic to take a longer path through the redistribution point. The solution is to change the metric type to E1 during redistribution, so the total cost includes the internal path cost, allowing OSPF to choose the better path.

A third scenario: a network engineer manually sets ip ospf cost on an interface to influence path selection, but does so inconsistently. For example, they set cost 10 on a Gigabit Ethernet link to make it less preferred, but forget to set cost on a backup 100 Mbps link (which defaults to 1). Now the backup link is preferred. The fix is to either set cost on all interfaces or use reference bandwidth consistently.

Scale considerations: In very large OSPF networks with hundreds of routers, changing the reference bandwidth can cause a massive SPF recalculation, potentially overloading CPUs. It's best to plan such changes during maintenance windows. Performance-wise, OSPF's SPF algorithm runs in O(log n) time, but with many routes, it can still be CPU-intensive. Using manual cost on a few key interfaces is often safer than changing the global reference bandwidth.

Misconfiguration consequences: If you set auto-cost reference-bandwidth to a value that makes all costs 1 (e.g., 1000 on 10 Gbps links), you lose the ability to differentiate high-speed links. Traffic may become imbalanced. Also, if you manually set cost on some interfaces but not others, you create inconsistencies that are hard to troubleshoot.

How CCNA 200-301 Actually Tests This

The CCNA 200-301 exam objective 3.4 is 'Troubleshoot OSPFv2 for IPv4.' The exam expects you to identify why OSPF chooses a suboptimal path and apply the correct fix. The most common wrong answers candidates choose are:

1.

'The router with higher Router ID becomes DR, so it controls path selection.' This is false. Router ID is used for DR/BDR election, but DR/BDR only affects LSA flooding, not path selection. Path selection is based on cost and route type.

2.

'The path with the lower hop count is preferred.' OSPF does not use hop count; it uses cost based on bandwidth. Candidates confuse OSPF with RIP.

3.

'Changing the bandwidth on an interface changes the OSPF cost automatically.' This is true, but many candidates forget that the bandwidth command is a parameter that can be set independently of the actual link speed. They think changing the physical interface speed changes cost, but it does not—you must change the bandwidth parameter or use ip ospf cost.

4.

'OSPF always prefers the path with the lowest metric regardless of route type.' This is false. Intra-area routes are always preferred over inter-area, even if inter-area has a lower metric. Candidates often miss this hierarchy.

Specific values and defaults to memorize: default reference bandwidth 100 Mbps, default cost for FastEthernet (100 Mbps) is 1, GigabitEthernet (1000 Mbps) is 1, 10 Gbps is 1. Administrative distance of OSPF is 110. Maximum paths default is 4.

Calculation traps: If the reference bandwidth is changed to 1000, a 100 Mbps link has cost 10 (1000/100 = 10), a 1 Gbps link has cost 1 (1000/1000 = 1), a 10 Gbps link has cost 1 (1000/10000 = 0.1 rounded to 1). So 1 Gbps and 10 Gbps are still equal. To differentiate them, set reference bandwidth to 10000 (10 Gbps) or use manual cost.

Decision rule for scenario questions: First, identify the route type (O, O IA, E1, etc.). If route types are the same, compare cost. If costs are equal, OSPF load-balances. If route types differ, the higher preference route wins regardless of cost. If the expected path is not installed, check administrative distance and whether the route is in the LSDB. Use elimination: if the question mentions 'intra-area' vs 'inter-area', the intra-area always wins. If it mentions 'load balancing', check for equal cost.

Key Takeaways

OSPF cost = reference-bandwidth / interface-bandwidth; default reference bandwidth is 100 Mbps.

Intra-area (O) routes are preferred over inter-area (O IA) routes, regardless of metric.

To differentiate high-speed links, change reference bandwidth with 'auto-cost reference-bandwidth' or set manual cost with 'ip ospf cost'.

Default OSPF administrative distance is 110; another protocol with lower AD overrides OSPF.

Use 'show ip route ospf' and 'show ip ospf interface' to verify path selection and cost.

Equal-cost paths (same route type and cost) are load-balanced by default up to 4 paths.

External routes: E1 adds internal cost, E2 does not; E1 is preferred over E2 only if total cost is lower.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

OSPF Cost Calculation

Cost = reference-bandwidth / interface-bandwidth

Only bandwidth is used by default

Static metric; does not change with load

Equal-cost paths load-balanced

Simple, but cannot differentiate high-speed links without manual tweaks

EIGRP Metric Calculation

Metric = (K1*BW + K2*BW/(256-load) + K3*delay) * 256

Uses bandwidth, delay, load, reliability (default: BW + delay)

Can include dynamic load and reliability

Unequal-cost load balancing with variance

More complex but more accurate for path selection

Watch Out for These

Mistake

OSPF uses hop count to determine the best path.

Correct

OSPF uses cost, which is based on bandwidth, not hop count. RIP uses hop count.

Candidates often confuse OSPF with RIP because both are dynamic routing protocols.

Mistake

The router with the highest Router ID becomes the DR and thus decides the path for all routers.

Correct

DR/BDR only manage LSA flooding on multiaccess networks; they do not influence path selection. Path selection is based on cost and route type.

The term 'Designated Router' sounds authoritative, leading to the misconception that it controls routing decisions.

Mistake

Changing the physical interface speed automatically updates the OSPF cost.

Correct

OSPF cost is based on the configured 'bandwidth' parameter on the interface, not the actual speed. You must change the bandwidth or set 'ip ospf cost' to affect cost.

Cisco IOS does not automatically adjust the bandwidth parameter when the interface speed changes; it's a common oversight.

Mistake

OSPF always prefers the path with the lowest metric, even if it's an inter-area route vs an intra-area route.

Correct

OSPF route type hierarchy: intra-area (O) is preferred over inter-area (O IA) regardless of metric. Only if route types are equal is metric compared.

The SPF algorithm calculates shortest path based on cost, but the route type tie-breaker is applied after cost calculation.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

Why does OSPF choose a slower link when a faster link is available?

OSPF chooses paths based on cost, which is calculated from the interface's configured bandwidth (not actual speed). If both links have the same cost (e.g., cost 1), OSPF will load-balance across them. This often happens when the reference bandwidth is still at the default 100 Mbps, making 100 Mbps, 1 Gbps, and 10 Gbps all cost 1. To fix, either increase the reference bandwidth or manually set cost on interfaces. Also check if one path is inter-area and the other intra-area, because intra-area is always preferred regardless of cost.

How do I check the OSPF cost on an interface?

Use the command 'show ip ospf interface <interface>'. Look for the line 'Cost: <value>'. For example, 'show ip ospf interface GigabitEthernet0/1' might show 'Cost: 1'. You can also see the network type, timers, and neighbor state there. To see the cost for all interfaces, use 'show ip ospf interface brief'.

What is the difference between OSPF E1 and E2 routes?

E1 (External Type 1) routes add the internal cost from the ASBR to the external metric, so the total cost is external metric + internal cost along the path. E2 (External Type 2) routes use only the external metric, ignoring internal cost. By default, redistributed routes are E2. E1 is preferred over E2 only if the total cost (external + internal) is lower than the E2 cost. This can cause suboptimal path selection if the internal path is long. To fix, use 'metric-type type-1' during redistribution.

Can I change the administrative distance of OSPF?

Yes, you can change the administrative distance for OSPF routes using the 'distance' command under router OSPF. For example, 'distance 120' sets OSPF AD to 120. You can also set distance for specific routes using 'distance <value> <source-ip> <wildcard>'. However, changing AD is a drastic measure and can cause routing loops if not done carefully. It's better to fix the metric or route type first.

Why does 'show ip route' show two OSPF routes to the same destination?

That means OSPF has multiple equal-cost paths to that destination. By default, OSPF installs up to 4 equal-cost paths in the routing table and load-balances traffic across them. You can see the number of paths with 'show ip route <destination>'. To change the maximum number of paths, use 'maximum-paths <number>' under router OSPF. If you want only one path, set maximum-paths to 1.

How does OSPF handle load balancing across unequal-cost links?

OSPF does not support unequal-cost load balancing. It only load-balances across equal-cost paths. If you need unequal-cost load balancing, you must use EIGRP (with variance) or use policy-based routing (PBR). Some engineers use manual cost manipulation to make paths equal-cost, but that's not true unequal-cost balancing.

What is the 'bandwidth' command and how does it affect OSPF?

The 'bandwidth' command sets the bandwidth parameter on an interface in kilobits per second. OSPF uses this value to calculate cost. By default, the bandwidth matches the interface speed (e.g., 100000 for FastEthernet), but it can be changed manually. For example, 'bandwidth 10000' on a GigabitEthernet interface makes OSPF think the link is 10 Mbps, increasing cost. This is a common trick to influence path selection without changing the actual link speed.

Terms Worth Knowing

Ready to put this to the test?

You've just covered Troubleshoot: OSPF Choosing Wrong Path — now see how well it sticks with free CCNA 200-301 practice questions. Full explanations included, no account needed.

Done with this chapter?