Compute OSPF cost from reference bandwidth, predict the DR/BDR election on a multiaccess segment, and inject a default route into OSPF with default-information originate.
Week 5 · Lesson 5 · Active ~35 min · Video ~6 min (optional) · Domain: IP Connectivity
You should have OSPF configured with neighbors reaching FULL. This lesson refines behavior on top of a working config — which path wins, who leads a shared segment, and how to advertise a default.
Prerequisites: ospf-single-area-configuration
Paths: Start lesson · Test out (jump to the quick check) · Review sheet
Baseline check
A router reaches a network by two OSPF paths: one over a Gigabit link, one over a 10-Gigabit link. With default OSPF settings, which path does it prefer? Commit to an answer before continuing.
The surprising answer — it may see them as equal cost — is the reference-bandwidth problem this lesson fixes.
OSPF cost is bandwidth-based, and lower wins. OSPF's metric is cost, and the cost of a path is the sum of the outbound interface costs along it. Each interface cost is:
cost = reference bandwidth ÷ interface bandwidth
The default reference bandwidth is 100 Mbps (10⁸ bps). So a 10 Mbps Ethernet is cost 10, a 100 Mbps Fast Ethernet is cost 1 — and anything faster than 100 Mbps also rounds to cost 1, because the formula floors at a minimum of 1. That is the baseline trap: with defaults, a 1 Gbps link and a 10 Gbps link both show cost 1, so OSPF cannot tell them apart.
The fix is a consistent reference bandwidth. Raise the reference so fast links get distinct costs, and set the same value on every router in the domain so their calculations agree:
R1(config)# router ospf 1
R1(config-router)# auto-cost reference-bandwidth 10000 ! reference now 10 Gbps
With a 10 Gbps reference, a 1 Gbps link becomes cost 10 and a 10 Gbps link cost 1 — now distinguishable. You can also hard-set a single interface's cost directly, which overrides the formula:
R1(config-if)# ip ospf cost 5
Why must reference bandwidth be the same on all routers?
Each router computes the cost of its own outbound interfaces and sums them along a path. If R1 uses a 100 Mbps reference and R2 uses a 10 Gbps reference, the same physical link is counted as cost 1 on one router and cost 100 on the other. The routers then disagree about which end-to-end path is cheapest, producing inconsistent or sub-optimal routing. Consistency, not the specific number, is what keeps the SPF results coherent across the area.
Why a DR exists. On a broadcast multiaccess segment (Ethernet) with several routers, having every router flood LSAs to every other router is wasteful. OSPF elects a Designated Router (DR) and Backup DR (BDR): all other routers (DROTHERs) form FULL adjacencies only with the DR and BDR and send their updates to the DR (multicast 224.0.0.6), which re-floods to everyone (224.0.0.5). DROTHERs stay at 2-WAY with each other — normal, not a fault.
The election, in order:
- Highest interface OSPF priority (0–255, default 1). Priority 0 = ineligible for DR/BDR.
- If priority ties, highest Router ID wins.
Two properties trip people up. The election is per segment — a router can be DR on one Ethernet and a DROTHER on another. And it is non-preemptive: once a DR is chosen, bringing on a higher-priority router does not displace it until the OSPF process on that segment is reset. Point-to-point and point-to-multipoint links skip election entirely — there is no DR/BDR on a serial or /30 point-to-point link.
Injecting a default route. An edge router with a path to the internet can advertise a default route into OSPF so every internal router learns "send unknown traffic to me":
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1 ! R1's own default toward ISP
R1(config)# router ospf 1
R1(config-router)# default-information originate
default-information originate advertises the default only if R1 actually has one in its table (the static above). Other OSPF routers then install it, typically shown as O*E2 0.0.0.0/0 — the * marks it as the candidate default. Adding always forces the advertisement even without a real default, which is a lab hazard (it can blackhole traffic).
DR/BDR election, cost, and default-information originate (topic guide)
Free CCNA | OSPF Part 3 | Day 28 | CCNA 200-301 Complete Course
~6 min
Optional depth on cost, the DR/BDR election, and default-route injection. The written lesson covers the exam-tested points.
Skip if you can compute cost and predict a DR election.
Watch on YouTubePredict the DR and read the cost
R3# show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.23.3/24, Area 0
Process ID 1, Router ID 3.3.3.3, Network Type BROADCAST, Cost: 1
State DR, Priority 1
Designated Router (ID) 3.3.3.3, Interface address 10.1.23.3
Backup Designated Router (ID) 2.2.2.2, Interface address 10.1.23.2
Hello 10, Dead 40
Read it: this is a BROADCAST segment, so it elects a DR/BDR. Cost 1 — a Gigabit interface under the default 100 Mbps reference. State DR, Priority 1: R3 won the election. Since priorities tie at the default 1, the tiebreaker was the highest Router ID — 3.3.3.3 beat 2.2.2.2, which took BDR. If you wanted R2 to be DR instead, you would raise its priority (ip ospf priority 110) and reset OSPF on the segment — remember the election is non-preemptive, so the change alone will not flip it.
Pause and predict
On the 10.1.23.0/24 Ethernet, R2 (RID 2.2.2.2), R3 (RID 3.3.3.3), and R4 (RID 4.4.4.4, priority 0) all run OSPF with default priority except R4. 1) Who becomes DR and BDR? 2) After a downstream router runs default-information originate with a valid static default, what route code do the others see for 0.0.0.0/0?
Reveal answer
- R4 is ineligible (priority 0), so it is out. R2 and R3 tie on priority (default 1), so the highest RID wins the DR role: R3 (3.3.3.3) becomes DR, R2 becomes BDR. R4 remains a DROTHER and sits at 2-WAY with the other DROTHERs. 2) The other routers install the injected default as O*E2 0.0.0.0/0 — an OSPF external Type 2 route flagged as the candidate default (their gateway of last resort).
In the trainer, notice how an OSPF route's [110/metric] reflects summed cost, and how a candidate-default line becomes the gateway of last resort.
Open routing-tableQuick check (3 items) · test
Answer from memory:
- What is the cost of a 1 Gbps interface under the default reference bandwidth, and why is that a problem?
- Two routers tie on OSPF priority. What decides the DR, and why will raising priority later not change it?
- What does default-information originate require before it will actually advertise a default?
Review sheet
- Cost = reference BW ÷ interface BW; default reference 100 Mbps; sum costs along the path, lower wins.
- Fast Ethernet and faster tie at cost 1 — raise
auto-cost reference-bandwidthconsistently everywhere. - DR/BDR election: highest priority, then highest RID; priority 0 = ineligible; non-preemptive; per segment.
- No DR/BDR on point-to-point or point-to-multipoint links.
- default-information originate injects a default (seen as O*E2) only if the router has one —
alwaysoverrides.
You can configure and tune OSPF; next you verify it end to end and diagnose the adjacency and route faults that appear in real topologies.
Next: OSPF Verification and Troubleshooting