Bring up single-area OSPFv2 and OSPFv3 and read every neighbor state
Task
Run OSPF in area 0 across three routers: a point-to-point link between R1 and R2, and a shared Ethernet segment where R1, R2 and R3 elect a designated router. You work out the wildcard masks, predict the router IDs and the DR/BDR election, change a router ID the way lesson 15 describes, see that the election does not preempt, and plant a hello-timer mismatch that drops a neighbor without any loud error. Then you add OSPFv3 for IPv6 on the point-to-point link. At the end you can read show ip ospf neighbor and say why each neighbor is in the state it is in.
Topology
Devices
| Device | Model | Role |
|---|---|---|
| R1 | ISR4331 | OSPF router, PC1's gateway |
| R2 | ISR4331 | OSPF router, PC2's gateway |
| R3 | ISR4331 | OSPF router on the shared segment |
| S1 | 2960-24TT | switch for the shared segment |
| PC1 | PC-PT | host on R1's LAN |
| PC2 | PC-PT | host on R2's LAN |
Links
| From | To |
|---|---|
| R1 G0/0/0 | R2 G0/0/0 |
| R1 G0/0/1 | S1 Fa0/1 |
| R2 G0/0/1 | S1 Fa0/2 |
| R3 G0/0/1 | S1 Fa0/3 |
| PC1 Fa0 | R1 G0/0/2 |
| PC2 Fa0 | R2 G0/0/2 |
Addressing
| Device | Interface | Address | Default gateway |
|---|---|---|---|
| R1 | Loopback0 | 10.255.255.1/32 | none |
| R1 | G0/0/0 | 10.0.12.1/30 and 2001:db8:0:12::1/64 | none |
| R1 | G0/0/1 | 10.1.1.1/24 | none |
| R1 | G0/0/2 | 192.168.10.1/24 and 2001:db8:10::1/64 | none |
| R2 | Loopback0 | 10.255.255.2/32 | none |
| R2 | G0/0/0 | 10.0.12.2/30 and 2001:db8:0:12::2/64 | none |
| R2 | G0/0/1 | 10.1.1.2/24 | none |
| R2 | G0/0/2 | 192.168.20.1/24 and 2001:db8:20::1/64 | none |
| R3 | Loopback0 | 10.255.255.3/32 | none |
| R3 | G0/0/1 | 10.1.1.3/24 | none |
| PC1 | NIC | 192.168.10.10/24 | 192.168.10.1 |
| PC1 | NIC (IPv6) | 2001:db8:10::10/64 | 2001:db8:10::1 |
| PC2 | NIC | 192.168.20.10/24 | 192.168.20.1 |
| PC2 | NIC (IPv6) | 2001:db8:20::10/64 | 2001:db8:20::1 |
Steps
- Drag each device from the Topology onto the workspace and set its display name (click the device, Config tab, Display Name) to the name in the Devices table. Cable the ports the Links table lists: Packet Tracer's automatic connection type picks the right cable, or use a copper cross-over between two routers or between a router and a PC or server. If a router asks whether to enter the initial configuration dialog, answer
no. S1 needs no configuration until step 6: all its ports start in VLAN 1. - Address R1, loopback first. R2 and R3 on the shared segment get OSPF priority 10, the lesson's worked example; R1 keeps the default of 1:
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# ipv6 unicast-routing
R1(config)# interface loopback0
R1(config-if)# ip address 10.255.255.1 255.255.255.255
R1(config-if)# interface g0/0/0
R1(config-if)# ip address 10.0.12.1 255.255.255.252
R1(config-if)# ipv6 address 2001:db8:0:12::1/64
R1(config-if)# no shutdown
R1(config-if)# interface g0/0/1
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# interface g0/0/2
R1(config-if)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:10::1/64
R1(config-if)# no shutdown
R1(config-if)# end
- Address R2 and R3:
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# ipv6 unicast-routing
R2(config)# interface loopback0
R2(config-if)# ip address 10.255.255.2 255.255.255.255
R2(config-if)# interface g0/0/0
R2(config-if)# ip address 10.0.12.2 255.255.255.252
R2(config-if)# ipv6 address 2001:db8:0:12::2/64
R2(config-if)# no shutdown
R2(config-if)# interface g0/0/1
R2(config-if)# ip address 10.1.1.2 255.255.255.0
R2(config-if)# ip ospf priority 10
R2(config-if)# no shutdown
R2(config-if)# interface g0/0/2
R2(config-if)# ip address 192.168.20.1 255.255.255.0
R2(config-if)# ipv6 address 2001:db8:20::1/64
R2(config-if)# no shutdown
R2(config-if)# end
Router> enable
Router# configure terminal
Router(config)# hostname R3
R3(config)# interface loopback0
R3(config-if)# ip address 10.255.255.3 255.255.255.255
R3(config-if)# interface g0/0/1
R3(config-if)# ip address 10.1.1.3 255.255.255.0
R3(config-if)# ip ospf priority 10
R3(config-if)# no shutdown
R3(config-if)# end
Give PC1 and PC2 their IPv4 and IPv6 addresses and gateways from the Addressing table (Desktop > IP Configuration). 4. Work out the wildcards before you type: a /30 is 0.0.0.3, a /24 is 0.0.0.255, and a single loopback address is 0.0.0.0. Start OSPF with no router-id command, so each router chooses its own. R2 deliberately uses process 2: process IDs are local. The point-to-point network type goes on both ends of the R1 to R2 link, and the PC LANs are passive.
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# network 10.255.255.1 0.0.0.0 area 0
R1(config-router)# network 10.0.12.0 0.0.0.3 area 0
R1(config-router)# network 10.1.1.0 0.0.0.255 area 0
R1(config-router)# network 192.168.10.0 0.0.0.255 area 0
R1(config-router)# passive-interface g0/0/2
R1(config-router)# exit
R1(config)# interface g0/0/0
R1(config-if)# ip ospf network point-to-point
R1(config-if)# end
R2# configure terminal
R2(config)# router ospf 2
R2(config-router)# network 10.255.255.2 0.0.0.0 area 0
R2(config-router)# network 10.0.12.0 0.0.0.3 area 0
R2(config-router)# network 10.1.1.0 0.0.0.255 area 0
R2(config-router)# network 192.168.20.0 0.0.0.255 area 0
R2(config-router)# passive-interface g0/0/2
R2(config-router)# exit
R2(config)# interface g0/0/0
R2(config-if)# ip ospf network point-to-point
R2(config-if)# end
R3# configure terminal
R3(config)# router ospf 1
R3(config-router)# network 10.255.255.3 0.0.0.0 area 0
R3(config-router)# network 10.1.1.0 0.0.0.255 area 0
R3(config-router)# end
- Predict R2's router ID, then check. R2's highest address is 192.168.20.1, but a loopback is up, so the loopback wins:
R2# show ip protocols
Expect Router ID 10.255.255.2, the networks you entered, and GigabitEthernet0/0/2 under the passive interfaces. 6. Force a clean DR/BDR election. The election only counts routers that are present when it runs, so drop and restore the whole shared segment at once from S1:
Switch> enable
Switch# configure terminal
Switch(config)# hostname S1
S1(config)# interface range fa0/1 - 3
S1(config-if-range)# shutdown
S1(config-if-range)# no shutdown
S1(config-if-range)# end
Wait about a minute (Fast Forward Time speeds this up). Predict the result first: R2 and R3 tie on priority 10, so the higher router ID, R3, becomes DR and R2 becomes BDR; R1, at priority 1, is a DROTHER. Then read it:
R1# show ip ospf neighbor
On GigabitEthernet0/0/1 expect 10.255.255.3 as FULL/DR and 10.255.255.2 as FULL/BDR. On GigabitEthernet0/0/0 expect 10.255.255.2 as FULL/ -: no DR on a point-to-point link. If the roles differ, the segment came up unevenly; repeat the shutdown and no shutdown together. 7. Change R1's router ID. IOS accepts the command but warns that it waits for a reset:
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# router-id 10.255.255.11
% OSPF: Reload or use "clear ip ospf process" command, for this to take effect
R1(config-router)# end
R1# clear ip ospf process
Reset ALL OSPF processes? [no]: yes
R2# show ip ospf neighbor
The reset drops and rebuilds R1's adjacencies, and R2 now lists R1 as 10.255.255.11. 8. Show that the election does not preempt. Give R1 the highest priority on the segment:
R1# configure terminal
R1(config)# interface g0/0/1
R1(config-if)# ip ospf priority 200
R1(config-if)# end
R1# show ip ospf interface g0/0/1
R1 stays a DROTHER with priority 200. It would rise only if the DR or BDR failed or the segment's OSPF were reset. 9. Break and fix: plant a hello-timer mismatch on the point-to-point link.
R2# configure terminal
R2(config)# interface g0/0/0
R2(config-if)# ip ospf hello-interval 5
R2(config-if)# end
Wait 40 seconds, then on R1 run show ip ospf neighbor. The neighbor on GigabitEthernet0/0/0 has gone without a trace, while the one on the shared segment stays FULL, and PC1 can still reach PC2 over the shared segment: a quiet failure. Find the cause by comparing the two ends:
R1# show ip ospf interface g0/0/0
R2# show ip ospf interface g0/0/0
R1 shows Hello 10, Dead 40, R2 shows Hello 5, Dead 20. Fix R2 and watch the neighbor return to FULL:
R2# configure terminal
R2(config)# interface g0/0/0
R2(config-if)# no ip ospf hello-interval
R2(config-if)# no ip ospf dead-interval
R2(config-if)# end
- Add OSPFv3 on the point-to-point link and the PC LANs of R1 and R2. OSPFv3 is enabled per interface, and its router ID is still a 32-bit dotted number:
R1# configure terminal
R1(config)# ipv6 router ospf 1
R1(config-rtr)# router-id 10.255.255.1
R1(config-rtr)# exit
R1(config)# interface g0/0/0
R1(config-if)# ipv6 ospf 1 area 0
R1(config-if)# interface g0/0/2
R1(config-if)# ipv6 ospf 1 area 0
R1(config-if)# end
R2# configure terminal
R2(config)# ipv6 router ospf 1
R2(config-rtr)# router-id 10.255.255.2
R2(config-rtr)# exit
R2(config)# interface g0/0/0
R2(config-if)# ipv6 ospf 1 area 0
R2(config-if)# interface g0/0/2
R2(config-if)# ipv6 ospf 1 area 0
R2(config-if)# end
R1# show ipv6 ospf neighbor
R1# show ipv6 route
The OSPFv3 route to 2001:DB8:20::/64 points at an FE80 link-local next hop, not at R2's global address, because OSPFv3 talks from link-local addresses.
Verify
R1# show ip ospf neighbor
R1# show ip ospf interface g0/0/1
R1# show ipv6 route
C:\> ping 192.168.20.10
C:\> ping 2001:db8:20::10
Expected output: show ip ospf neighbor lists 10.255.255.3 as FULL/DR and 10.255.255.2 as FULL/BDR on GigabitEthernet0/0/1, and 10.255.255.2 as FULL/ - on GigabitEthernet0/0/0. show ip ospf interface g0/0/1 shows State DROTHER, Priority 200 and Designated Router (ID) 10.255.255.3. show ipv6 route has an O 2001:DB8:20::/64 [110/2] entry via an FE80 address. Both pings from PC1 print Reply from lines.
Save your work
Save the topology as ccna-lab15-ospf.pkt (File > Save As).
Notes
The shared segment carries IPv4 only, to keep the lab inside 45 minutes; OSPFv3 elects a DR and BDR on a broadcast segment by the same rules. With only one DROTHER on the segment you never see a 2WAY pair here; lesson 15 shows that state between two DROTHERs. R1's IPv4 routes to 192.168.20.0/24 show two equal [110/2] paths, one over each link, which is lesson 13's load sharing.
This is an independent study companion for the Cisco CCNA 200-301 v2.0 exam and is not produced by or endorsed by Cisco. Cisco, CCNA and IOS are trademarks of Cisco Systems, Inc.
This is an independent study companion for Cisco CCNA 200-301 and is not produced by or endorsed by CompTIA.