Lab 2 — OSPF

Three routers, one segment, one routing table.

Stand up OSPF, control the DR/BDR election, and read the routing table to prove the routes are really there. Work through it in order — check steps off, copy the commands, and finish with the show commands.

Interactive lab — play with it

A simulated CLI for this lab. Click a router, type the commands, and watch neighbors and routes appear as you configure them.

A simulated CLI for this lab — click a router, type the commands, and watch neighbors and routes appear only when both sides agree. This models Lab 2’s commands only, not a real router: unsupported commands say so instead of faking it. Type ? for help and use Tab to complete a command.

Setting up…
Topologydrag to pan · double-click a device for its console
G0/1 · 10.0.0.0/24
G0/1 · 10.0.0.0/24
100%
user EXEC
Lab 2 — OSPF simulator — simulated IOS 15.0(1)M4. Type ? for help.
Only this lab's commands are simulated; unsupported commands say so.
R1>

Up/down arrows recall commands. The full command list is in the walkthrough below.

Interactive lab

Lab 2 — OSPF

Three routers on one shared segment, each with its own LAN. Stand up OSPF, control the DR/BDR election, and prove the routes are really there.

Click a device to open its console, type the real commands, and check your work when you think it’s done. The lab checks each step as you go.

Walkthrough — commands in order

Three routers on one shared segment, each with its own LAN. Stand up OSPF, control the DR/BDR election, and read the routing table to prove the routes are really there.

       10.0.0.0/24 — shared Ethernet segment (DR/BDR election here)
  R1 ───────────────────── R2 ───────────────────── R3
  Lo0 1.1.1.1            Lo0 2.2.2.2            Lo0 3.3.3.3
  G0/0 192.168.1.0/24    G0/0 192.168.2.0/24    G0/0 192.168.3.0/24
  (DR, priority 200)     (BDR, priority 100)   (never DR/BDR, priority 0)

Where this shows up in the data center

Honest framing: OSPF isn’t the protocol running inside the hyperscale fabric at Oracle. But the fundamentals are the same ones I use daily — a stable router ID that never goes down with a link, neighbor adjacencies you verify before trusting a path, and reading the routing table to see where traffic should actually go. It’s the same discipline as checking LLDP neighbors and optical levels before touching a fiber link: prove the path, then change it.

R1(config)# interface loopback0
R1(config-if)# ip address 1.1.1.1 255.255.255.255
R1(config-if)# interface g0/1
R1(config-if)# ip address 10.0.0.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface g0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# no shutdown

R2 uses 10.0.0.2 / 2.2.2.2 / 192.168.2.1, R3 uses 10.0.0.3 / 3.3.3.3 / 192.168.3.1 — same pattern.

R1(config)# router ospf 1
R1(config-router)# router-id 1.1.1.1
R1(config-router)# network 10.0.0.0 0.0.0.255 area 0
R1(config-router)# network 192.168.1.0 0.0.0.255 area 0

The 1 in "router ospf 1" is the process ID — local to the router, it doesn’t have to match the neighbors.

R1(config-router)# passive-interface g0/0

Do the same on R2 and R3 for their LAN interfaces. Forgetting this is a classic exam trap.

R1(config)# interface g0/1
R1(config-if)# ip ospf priority 200
R2(config)# interface g0/1
R2(config-if)# ip ospf priority 100
R3(config)# interface g0/1
R3(config-if)# ip ospf priority 0

The election isn’t preemptive — if the DR goes down, the BDR is promoted and a new BDR is elected. R3 can never be DR or BDR with priority 0.

R1(config)# interface g0/1
R1(config-if)# ip ospf cost 10

A 10 Mbps link with the default reference costs 10; a 1 Gbps link costs 1. Same math, just settable by hand.

Verify it worked

Don’t trust the config until a show command proves it. These are the outputs you should see — if yours differ, that’s the troubleshooting.

R1# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2         100   FULL/BDR        00:00:38    10.0.0.2      GigabitEthernet0/1
3.3.3.3         0     FULL/DROTHER    00:00:36    10.0.0.3      GigabitEthernet0/1

R1# show ip route ospf

O    192.168.2.0/24 [110/2] via 10.0.0.2, 00:12:41, GigabitEthernet0/1
O    192.168.3.0/24 [110/2] via 10.0.0.3, 00:12:41, GigabitEthernet0/1

R1# show ip protocols

Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 1.1.1.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.0.0.0 0.0.0.255 area 0
    192.168.1.0 0.0.0.255 area 0
  Passive Interface(s):
    GigabitEthernet0/0

Check yourself

Three questions from the exam angle. Tap to reveal the answer — say it out loud first.

Q1. What’s the wildcard mask for 192.168.1.0/26 in a network statement?

Q2. Two routers tie on priority in a DR election. What breaks the tie — and what breaks if their router IDs are duplicated?

Q3. What does passive-interface actually do to a network statement?

Next labs:

Keep going: Lab 3 — ACLs & NAT locks down an edge router and shares one public address, or go back to Lab 1 — VLANs, Trunking & STP. All eighteen are on the labs hub.