In this lab, I built a Layer 3 network using OSPF to dynamically exchange routes between routers. The routers use different networks behind them, and OSPF automatically advertises these networks so they can communicate with each other.
The lab also demonstrates OSPF route selection using interface cost. A redundant link between Router-1 and Router-2 was configured with a higher cost, allowing OSPF to prefer the lower-cost path while keeping the second link available as a backup. I also changed the OSPF reference bandwidth to 1000 Mbps for more appropriate cost calculations.
Loopback interfaces were used to represent local networks behind Router-1, Router-4, Router-5, and Router-6. The loopbacks were configured as point-to-point OSPF networks.
The main objectives of this lab were to:
Build a Layer 3 routed network using OSPF.
Dynamically advertise the local networks behind each router.
Establish OSPF neighbor relationships between multiple routers.
Demonstrate how OSPF selects routes based on interface cost.
Configure a redundant path between Router-1 and Router-2.
Use OSPF reference bandwidth to improve route-cost calculations.
Verify OSPF neighbors, routing information, and network reachability.
Test failover by shutting down the preferred link and allowing the redundant path to carry the traffic.
Below you can see the topology of this network:
R-4
/
/
R-1 ===== R-2 —————————————————— R-3 ————— R-5
\
\
R-6
The following IP addresses were configured:
Device Interface IP Address Subnet Mask Purpose
RT-1 Loopback1 192.168.10.1 255.255.255.0 (/24) Local network
RT-1 Gig0/0/0 10.1.1.1 255.255.255.252 (/30) Link to RT-2
RT-1 Gig0/0/1 10.1.1.5 255.255.255.252 (/30) Redundant link to RT-2
RT-2 Gig0/0/0 10.1.1.2 255.255.255.252 (/30) Link to RT-1
RT-2 Gig0/0/1 10.1.1.6 255.255.255.252 (/30) Redundant link to RT-1
RT-2 Serial0/1/0 10.1.2.1 255.255.255.248 (/29) PPP link to RT-3
RT-3 Serial0/1/0 10.1.2.2 255.255.255.252 (/30) PPP link to RT-2
RT-3 Gig0/0/0 10.1.3.1 255.255.255.248 (/29) Shared segment with RT-4/5/6
RT-4 Gig0/0/0 10.1.3.2 255.255.255.248 (/29) Shared segment with RT-3
RT-4 Loopback1 192.168.20.1 255.255.255.0 (/24) Local network
RT-5 Gig0/0/0 10.1.3.3 255.255.255.248 (/29) Shared segment with RT-3
RT-5 Loopback1 192.168.30.1 255.255.255.0 (/24) Local network
RT-6 Gig0/0/0 10.1.3.4 255.255.255.248 (/29) Shared segment with RT-3
RT-6 Loopback1 192.168.40.1 255.255.255.0 (/24) Local network
All OSPF interfaces were configured in Area 0. The OSPF process uses router IDs from 1.1.1.1 through 6.6.6.6.
Below I provided all configurations I made on the routers for this lab.
conf t
hostname RT-1
router ospf 1
router-id 1.1.1.1
auto-cost reference-bandwidth 1000
exit
interface loopback 1
ip ospf network point-to-point
ip address 192.168.10.1 255.255.255.0
ip ospf 1 area 0
exit
interface gig0/0/0
media-type sfp
ip address 10.1.1.1 255.255.255.252
ip ospf 1 area 0
no shutdown
exit
interface gig0/0/1
ip address 10.1.1.5 255.255.255.252
ip ospf 1 area 0
ip ospf cost 2
no shutdown
exit
do write
conf t
hostname RT-2
router ospf 1
router-id 2.2.2.2
auto-cost reference-bandwidth 1000
exit
interface gig0/0/0
media-type sfp
ip address 10.1.1.2 255.255.255.252
ip ospf 1 area 0
no shutdown
exit
interface gig0/0/1
ip address 10.1.1.6 255.255.255.252
ip ospf 1 area 0
ip ospf cost 2
no shutdown
exit
interface serial 0/1/0
encapsulation ppp
ip address 10.1.2.1 255.255.255.248
ip ospf 1 area 0
no shutdown
exit
do write
conf t
hostname Router-3
router ospf 1
router-id 3.3.3.3
auto-cost reference-bandwidth 1000
exit
interface serial 0/1/0
encapsulation ppp
ip address 10.1.2.2 255.255.255.252
ip ospf 1 area 0
no shutdown
exit
interface gig0/0/0
ip address 10.1.3.1 255.255.255.248
ip ospf 1 area 0
no shutdown
exit
do write
conf t
hostname Router-4
router ospf 1
router-id 4.4.4.4
auto-cost reference-bandwidth 1000
exit
interface gig0/0/0
ip address 10.1.3.2 255.255.255.248
ip ospf 1 area 0
no shutdown
exit
interface loopback 1
ip ospf network point-to-point
ip address 192.168.20.1 255.255.255.0
ip ospf 1 area 0
exit
do write
conf t
hostname Router-5
router ospf 1
router-id 5.5.5.5
auto-cost reference-bandwidth 1000
exit
interface gig0/0/0
ip address 10.1.3.3 255.255.255.248
ip ospf 1 area 0
no shutdown
exit
interface loopback 1
ip ospf network point-to-point
ip address 192.168.30.1 255.255.255.0
ip ospf 1 area 0
exit
do write
conf t
hostname Router-6
router ospf 1
router-id 6.6.6.6
auto-cost reference-bandwidth 1000
exit
interface gig0/0/0
ip address 10.1.3.4 255.255.255.248
ip ospf 1 area 0
no shutdown
exit
interface loopback 1
ip ospf network point-to-point
ip address 192.168.40.1 255.255.255.0
ip ospf 1 area 0
exit
do write
I used several commands to verify the OSPF configuration. The following results were collected from Router-3 as an example.
To verify the OSPF neighbor relationships:
show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:31 10.1.2.1 Serial0/1/0
4.4.4.4 1 2WAY/DROTHER 00:00:31 10.1.3.2 GigabitEthernet0/0/0
5.5.5.5 1 FULL/BDR 00:00:32 10.1.3.3 GigabitEthernet0/0/0
6.6.6.6 1 FULL/DR 00:00:36 10.1.3.4 GigabitEthernet0/0/0
To verify the OSPF routing information and administrative distance:
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 3.3.3.3
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
Routing Information Sources:
Gateway Distance Last Update
1.1.1.1 110 00:05:57
2.2.2.2 110 00:09:58
3.3.3.3 110 00:28:31
4.4.4.4 110 00:28:31
5.5.5.5 110 00:28:31
6.6.6.6 110 00:28:31
Distance: (default is 110)
To verify that the remote networks were learned through OSPF:
show ip route ospf
10.0.0.0/8 is variably subnetted, 7 subnets, 3 masks
O 10.1.1.0 [110/648] via 10.1.2.1, 00:41:11, Serial0/1/0
O 10.1.1.4 [110/649] via 10.1.2.1, 00:41:11, Serial0/1/0
O 192.168.10.0 [110/648] via 10.1.2.1, 00:37:13, Serial0/1/0
O 192.168.20.0 [110/1] via 10.1.3.2, 00:29:33, GigabitEthernet0/0/0
O 192.168.30.0 [110/1] via 10.1.3.3, 00:29:33, GigabitEthernet0/0/0
O 192.168.40.0 [110/1] via 10.1.3.4, 00:29:33, GigabitEthernet0/0/0
To make sure that networks are reachable for each other, I used ping tool:
ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/4/10 ms
ping 192.168.40.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/3 ms
I also tested the redundant connection between Router-1 and Router-2. The fiber link was configured with the lower OSPF cost and was therefore preferred as the primary path. I shut down this interface to simulate a link failure. OSPF detected the failure and selected the redundant link with the higher cost, allowing traffic to continue through the backup path.
During the configuration, I initially forgot to enable OSPF on the loopback interfaces. Because these networks were not being advertised by OSPF, their routes did not appear in the routing table of the other routers.
I reviewed the running configuration and found that the loopback interfaces were missing: ip ospf 1 area 0.
After adding this command to the loopback interfaces, OSPF advertised the networks correctly and the routes appeared in the routing tables.
The lab successfully demonstrated dynamic routing with OSPF across multiple interconnected routers. The local networks behind the routers were automatically advertised and installed in the routing tables without manually configuring static routes.
The lab also demonstrated OSPF neighbor formation, route-cost selection, a shared multi-access OSPF segment with DR/BDR election, and redundant-path failover. When the preferred Router-1–Router-2 link was disabled, OSPF automatically selected the backup path, maintaining network connectivity.
The startup configurations for each router and the Cisco Packet Tracer practice lab file are available on my GitHub for reference.