Your first OSPF network
Three routers in a triangle, each with a LAN and a loopback. All the addresses are set; there are no routes. Turn on OSPF process 1, area 0, on all three:
- Router IDs: R1
1.1.1.1, R22.2.2.2, R33.3.3.3. - Every link between routers, every LAN and every loopback is in OSPF.
- The LAN interfaces (R1 Gi0/0, R2 Gi0/2, R3 Gi0/2) are passive.
Use network commands or ip ospf 1 area 0, whichever you like. Leave the ISP link (R1 Gi0/3) out of OSPF.
How it works: this is VulnTech NetLab, a network simulator running in your browser. Click a device in the diagram to open its console and type commands, just like on real equipment (? shows help, Tab finishes a word). Click a cable to inspect it. Tasks tick themselves off as you complete them; questions are answered in the box under each task. Your work is kept if you reload; Reset starts the network over.
Solution explanation
One network line per interface, each with the wildcard that matches its subnet (0.0.0.3 for a /30, 0.0.0.255 for a /24, 0.0.0.0 for one address). The ISP link 203.0.113.0/30 matches none of them, so it stays out of OSPF. Loopbacks are always advertised as /32 host routes. The LAN interfaces are passive: their networks are still advertised, but no hellos go out where there are only PCs.
Show solution
[R1]
enable
configure terminal
router ospf 1
router-id 1.1.1.1
network 10.0.12.0 0.0.0.3 area 0
network 10.0.13.0 0.0.0.3 area 0
network 192.168.1.0 0.0.0.255 area 0
network 1.1.1.1 0.0.0.0 area 0
passive-interface g0/0
end
[R2]
enable
configure terminal
router ospf 1
router-id 2.2.2.2
network 10.0.12.0 0.0.0.3 area 0
network 10.0.23.0 0.0.0.3 area 0
network 192.168.2.0 0.0.0.255 area 0
network 2.2.2.2 0.0.0.0 area 0
passive-interface g0/2
end
[R3]
enable
configure terminal
router ospf 1
router-id 3.3.3.3
network 10.0.13.0 0.0.0.3 area 0
network 10.0.23.0 0.0.0.3 area 0
network 192.168.3.0 0.0.0.255 area 0
network 3.3.3.3 0.0.0.0 area 0
passive-interface g0/2
end
show ip ospf neighbor
show ip route ospf | begin Gateway
[PC1]
ping 192.168.2.10
ping 192.168.3.10