PracticeLabs
Week 5Lesson 5Required35 min estimated0% progress

OSPF Cost, DR/BDR, and Default Routes

Compute OSPF cost from reference bandwidth, predict the DR and BDR election on a multi-access segment, and inject a default route into OSPF.

Lesson orientation

What you'll learn (4 objectives)~35 min: video → lesson → check → apply → lab prep

Learning objectives

  • Compute OSPF cost as reference bandwidth divided by interface bandwidth, and explain the cost-1 tie
  • Predict a DR/BDR election from interface priority and Router ID, and state where election does not happen
  • Explain why the election is non-preemptive and how priority 0 removes a router from it
  • Advertise a default route into OSPF and read the resulting route code

Terms you will see

CostReference bandwidthauto-costDesignated RouterBackup DRPriorityNon-preemptivedefault-information originateO*E2

Time breakdown

  • Read the notes18 min
  • Routing Table Trainer10 min
  • Election prediction7 min

Assigned video

Opens on YouTube
Optional video

Free CCNA | OSPF Part 3 | Day 28 | CCNA 200-301 Complete Course

By Jeremy's IT Lab · Opens externally on YouTube

Assigned watch
~6 min

The link opens in a new browser tab. Return here when you finish watching.

Watch for these concepts

  • Cost, the DR/BDR election, and default-route injection

Go beyond the video

The assigned video introduces the idea. CCNA Practice Labs completes the learning path: clarify core concepts, explore how each device behaves, visualize the communication path, check your understanding, and prepare for hands-on lab work.

Watch the concept → understand it → visualize it → practice it → apply it.

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 the reference bandwidth divided by the interface bandwidth. The default reference bandwidth is 100 Mbps.

Interface cost under the default 100 Mbps reference
Interface speedCostNote
10 Mbps10100 ÷ 10
100 Mbps1100 ÷ 100
1 Gbps1Formula floors at a minimum of 1
10 Gbps1Also floors at 1 — indistinguishable from 1 Gbps
The default reference bandwidth is the trap
Anything faster than 100 Mbps rounds to cost 1, so with defaults a 1 Gbps link and a 10 Gbps link both show cost 1 and OSPF cannot tell them apart. It will happily choose the slower path. The fix is to raise the reference so fast links get distinct costs — auto-cost reference-bandwidth 10000 sets it to 10 Gbps, making a 1 Gbps link cost 10 and a 10 Gbps link cost 1.
Why the reference must be identical everywhere
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 10 Gbps, the same physical link counts as cost 1 on one router and cost 100 on the other. They then disagree about which end-to-end path is cheapest, producing inconsistent or sub-optimal routing. Consistency, not the specific number, is what keeps SPF results coherent across the area. You can also hard-set one interface with ip ospf cost 5, which overrides the formula entirely.

Why a DR exists, and who wins

On a broadcast multi-access segment with several routers, having every router flood LSAs to every other router is wasteful. OSPF elects a Designated Router and a Backup DR. All other routers — DROTHERs — form Full adjacencies only with the DR and BDR, and send their updates to the DR on multicast 224.0.0.6, which re-floods to everyone on 224.0.0.5. DROTHERs remain at 2-WAY with each other, which is normal rather than a fault.

  1. Highest interface OSPF priority wins. The range is 0 to 255 and the default is 1. A priority of 0 makes a router ineligible for DR or BDR entirely.
  2. If priorities tie, the highest Router ID wins.
Two properties that 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 OSPF on that segment is reset. So raising a priority alone will not flip the role, which is a favourite exam scenario. Point-to-point and point-to-multipoint links skip election entirely — there is no DR or BDR on a /30 point-to-point link.
Reading the election from show ip ospf interface
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: the network type is BROADCAST, so this segment elects a DR and BDR. Cost 1 is a Gigabit interface under the default reference. State DR with Priority 1 means R3 won — and since priorities tie at the default, the tiebreaker was the highest Router ID, so 3.3.3.3 beat 2.2.2.2, which took BDR.

Injecting a default route

Advertise a default into OSPF from the edge router
R1(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1    ! R1's own default toward the 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 own table — the static above. Other OSPF routers then install it, typically shown as O*E2 0.0.0.0/0, an OSPF external Type 2 route with the asterisk marking it as their candidate default. Adding always forces the advertisement even without a real default, which is a genuine hazard: it can blackhole traffic across the whole area.

What you should retain

  • Cost is reference bandwidth divided by interface bandwidth, summed along the path; lower wins.
  • The default reference is 100 Mbps, so Fast Ethernet and anything faster all tie at cost 1.
  • Raise auto-cost reference-bandwidth consistently on every router, or the results disagree.
  • DR election: highest priority, then highest Router ID. Priority 0 is ineligible.
  • The election is per segment and non-preemptive, and does not happen on point-to-point links.
  • default-information originate injects a default, seen as O*E2, only if the router has one — unless always is used.
Pause and predictNot scored — nothing is recorded

Before you read on

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?

Interactive tool
Required~10 min

Routing Table Trainer

Notice how an OSPF route's bracketed metric reflects summed cost along the path, and how a candidate-default line becomes the gateway of last resort. Both are things you read constantly and rarely get taught to read deliberately.

Study deeper

Topic guides extend this lesson — they do not replace the first-party walkthrough above.

OSPF Neighbours & Design

For DR/BDR behaviour, cost tuning, and default-information originate in more depth