Skip to main content
AD Academy
CCNA — Cisco Networking Fundamentals
Intermediate16 minLast updated: Topic 10 of 12

OSPFv2: Router ID, Hello and DR/BDR

Dynamic routing that updates itself: how neighbor adjacency is built, who is elected DR, and how to diagnose issues.

Not read

What you will learn here

  • Four things that must match between neighbors
  • Verification — How to check that it actually works
  • Common Errors (and what to check)

Worth reading first:EtherChannel: LACP and PAgP

Analogy: A static route is a permanent sign on the road — if the road closes, the sign still directs you there. OSPF is Waze: all routers report link status to each other and recalculate the route within seconds.

1. DOWN to INIT: a one-way Hello has been received. 2. 2-WAY: both routers see each other and, on Ethernet, DR and BDR are elected by priority and router ID. 3. EXSTART/EXCHANGE: database descriptors are swapped and MTU must match. 4. LOADING to FULL: the link-state databases are in sync. Router ID comes from manual configuration, then the highest loopback, then an active interface. Area, subnet, timers and authentication must match.

Four things that must match between neighbors

  • Same Area (e.g., Area 0) and same network/Subnet Mask on the link.
  • Same Hello and Dead Interval (default 10 / 40 seconds).
  • Same Authentication setting, if present.
  • Unique Router ID — chosen by manual router-id, otherwise by the highest Loopback, otherwise by an active interface.
  • In a shared Ethernet network, DR and BDR are elected by Priority (default 1) and in case of a tie, by the highest Router ID — they centralize the exchange of updates.
Router(config)# router ospf 1
Router(config-router)# router-id 1.1.1.1
Router(config-router)# network 192.168.10.0 0.0.0.255 area 0
Router(config-router)# network 10.0.0.0 0.0.0.3 area 0

! Do not send Hello towards users/servers
Router(config-router)# passive-interface gi0/1
Router(config-router)# default-information originate

! Force a specific router to be DR
Router(config-if)# ip ospf priority 255

! Checks
Router# show ip ospf neighbor
Router# show ip ospf interface brief
Router# show ip route ospf
bash

Verification — How to check that it actually works

R1# show ip ospf neighbor
Neighbor ID   Pri  State     Dead Time  Address       Interface
2.2.2.2         1  FULL/DR   00:00:34   10.0.0.2      GigabitEthernet0/0
3.3.3.3         1  FULL/BDR  00:00:31   10.0.0.3      GigabitEthernet0/0
! State = FULL → The LSDB is synchronized. Dead Time counts down from 40 and resets every Hello.

R1# show ip route ospf
O    192.168.20.0/24 [110/2] via 10.0.0.2, 00:04:11, GigabitEthernet0/0
O*E2 0.0.0.0/0       [110/1] via 10.0.0.2, 00:04:11, GigabitEthernet0/0
! O = Learned from OSPF · 110 = Administrative Distance · 2 = Cost

R1# show ip ospf interface brief
Interface  PID  Area  IP Address/Mask  Cost  State  Nbrs F/C
Gi0/0        1     0  10.0.0.1/30         1  DR       2/2
Gi0/1        1     0  192.168.10.1/24     1  DR       0/0
bash

Common Errors (and what to check)

  • Incorrect Wildcard Mask — /24 = 0.0.0.255, /30 = 0.0.0.3. Incorrect mask ⇒ interface does not enter OSPF at all (Nbrs 0/0).
  • MTU mismatch between neighbors — Adjacency gets stuck in EXSTART/EXCHANGE. Check with show interfaces and align to 1500.
  • Duplicate Router ID between two routers — Adjacency does not come up. Manually configure router-id and then clear ip ospf process.
  • Different Area on both sides of the link, or different Hello/Dead Timers — No neighbor at all.
  • Different Subnet Mask on the same link (e.g., /24 vs. /30) — OSPF refuses to form adjacency.
  • ACL or Authentication blocking Hello in one direction — Neighbor stuck in INIT.
  • Forgot passive-interface towards users — Hello sent to the user network, noise and security risk.
Architecture and Theory — Under the Hood

OSPF is Link-State: each router advertises LSAs, all build an identical map of the network (LSDB) and run Dijkstra's algorithm to calculate the shortest path.

Down -> Init -> 2-Way -> ExStart -> Exchange -> Loading -> FULL
                  ^                                        ^
            Hello received                             full adjacency

Hello=10s / Dead=40s (broadcast)   Cost = 100Mbps / BW
text
  • Router ID is determined once when the process starts and does not change on its own — a change requires clear ip ospf process, which is why it's always manually set on a stable Loopback.
  • DR/BDR are elected in a Broadcast network to reduce adjacencies; based on Priority and then Router ID. In Point-to-Point, there is no DR.
  • All neighbors must agree on: Area ID, Hello/Dead timers, authentication, MTU, and Subnet.
  • Passive-interface: The router still advertises the network but does not send Hellos — mandatory on user interfaces.
Practical configuration (CLI)
R(config)# router ospf 1
R(config-router)# router-id 1.1.1.1
R(config-router)# network 192.168.10.0 0.0.0.255 area 0
R(config-router)# network 10.0.0.0 0.0.0.3 area 0
R(config-router)# passive-interface gi0/1
R(config-router)# default-information originate
R(config)# interface gi0/0
R(config-if)# ip ospf priority 255        ! To force DR
R(config-if)# ip ospf cost 10
bash
Real-world scenarios in an organization
  • Multi-site network: Each branch advertises its networks, and recovery from failure is automatic.
  • Loopback as a stable Router ID — does not change even if an interface goes down.
  • Single-Area (area 0) is sufficient for most medium-sized organizations.
Troubleshooting and diagnosis
R# show ip ospf neighbor        ! Must be FULL or 2WAY (with DROTHER)
R# show ip ospf interface brief
R# show ip route ospf           ! Routes marked O / O*E2
R# show ip protocols
R# debug ip ospf adj
bash
  • Neighbor stuck in EXSTART/EXCHANGE → MTU mismatch between interfaces.
  • Neighbor is in 2-WAY state and that's normal → in a Broadcast network, only DR/BDR reach FULL, other routers intentionally remain in 2-WAY.
  • Duplicate Router ID → neighbor relationship disconnects and reconnects repeatedly.
  • Neighbor disappears every 40 seconds → Loss of Hello packets on the line.
Glossary and quick command line
  • 110 | Cost = 100M/BW | Hello 10 / Dead 40
  • network <net> <wildcard> area <n>
  • show ip ospf neighbor — Command number 1
  • Normal state: FULL/DR, FULL/BDR, FULL/ -

Check yourself

Which OSPF neighbor state indicates full stability?

What does passive-interface do in OSPF?

Was this page helpful?