Exam ScenariosCCNA 200-301

OSPF Cost Calculation on Exam — Common Mistakes

Presenting Symptom

A router in an OSPF network is not learning routes from a neighbor, even though the neighbor adjacency is established and both routers are in the same area.

Network Context

The network consists of two Cisco routers (R1 and R2) connected via a FastEthernet link in OSPF area 0. Both routers run IOS 15.x. The link bandwidth is 100 Mbps. R1's OSPF cost to reach a loopback on R2 is unexpectedly high, causing R1 to prefer a suboptimal path through a third router.

Diagnostic Steps

1

Check OSPF neighbor state

show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/DR         00:00:35    10.0.0.2        FastEthernet0/0

The neighbor state is FULL, indicating the adjacency is established. The problem is not with neighbor formation.

2

Examine OSPF interface cost

show ip ospf interface fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 10.0.0.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10

The cost is 10. For a 100 Mbps link, the default OSPF cost should be 1 (reference bandwidth 100 Mbps / interface bandwidth 100 Mbps = 1). A cost of 10 indicates the reference bandwidth or interface bandwidth is misconfigured.

3

Check interface bandwidth

show interfaces fastEthernet 0/0
FastEthernet0/0 is up, line protocol is up
  Hardware is Fast Ethernet, address is aaaa.bbbb.cccc
  MTU 1500 bytes, BW 10000 Kbit/sec, DLY 100 usec,

The bandwidth is 10000 Kbit/sec (10 Mbps), not the expected 100000 Kbit/sec (100 Mbps). This is the root cause: the interface bandwidth has been manually changed or is defaulting to a lower value.

4

Verify OSPF reference bandwidth

show running-config | section router ospf
router ospf 1
 network 10.0.0.0 0.0.0.255 area 0
 auto-cost reference-bandwidth 1000

The reference bandwidth is set to 1000 Mbps. With interface bandwidth of 10 Mbps, cost = 1000/10 = 100. But the show ip ospf interface showed cost 10, so the reference bandwidth is actually 100 Mbps (default). The mismatch between interface bandwidth and actual link speed causes incorrect cost.

Root Cause

The FastEthernet interface bandwidth is misconfigured to 10 Mbps (10000 Kbit/sec) instead of the default 100 Mbps. This causes OSPF to calculate a higher cost (10) than expected (1), leading to suboptimal routing.

Resolution

On R1, correct the interface bandwidth to 100 Mbps: interface FastEthernet0/0 bandwidth 100000 exit Then clear OSPF process to recalculate costs: clear ip ospf process Alternatively, set the OSPF reference bandwidth to a consistent value across all routers: router ospf 1 auto-cost reference-bandwidth 1000 exit

Verification

Run 'show ip ospf interface fastEthernet 0/0' and verify cost is now 1 (or appropriate value). Also run 'show ip route ospf' to confirm the correct route is installed.

Prevention

1. Always verify interface bandwidth matches the physical link speed when configuring OSPF. 2. Use the 'auto-cost reference-bandwidth' command consistently across all routers to avoid cost mismatches. 3. Document any non-default bandwidth settings.

CCNA Exam Relevance

On the CCNA 200-301 exam, OSPF cost calculation is tested in multiple-choice and simulation questions. Candidates must know the formula: cost = reference bandwidth / interface bandwidth. The default reference bandwidth is 100 Mbps. A common trap is that the exam may change the interface bandwidth or reference bandwidth, leading to unexpected costs.

Exam Tips

1.

Remember the default OSPF cost for FastEthernet is 1 (100/100). For GigabitEthernet, it's 1 as well (100/1000 = 0.1, but cost must be integer, so it becomes 1).

2.

If the reference bandwidth is changed, all routers in the OSPF domain must have the same reference bandwidth to avoid routing loops.

3.

Use 'show ip ospf interface' to quickly see the cost; if it seems off, check 'show interfaces' for bandwidth.

Commands Used in This Scenario

Test Your CCNA Knowledge

Practice with scenario-based questions to prepare for the CCNA 200-301 exam.

Practice CCNA Questions