- Published at
LAB 09 - OSPF (Open Shortest Path First) [Device by device procedures]
LAB 09 - OSPF (Open Shortest Path First) [Device by device procedures]
Table of Contents
Full Lab Procedures
LAB 09 - OSPF (Open Shortest Path First)
- Connect Ethernet cables to create the network topology as shown in Fig. 1.
- (a) Configure the IP addresses of all the interfaces.
- (b) Enable IP forwarding at R4 and R5 with
echo "1" > /proc/sys/net/ipv4/ip_forward
- Configure the Linux Routers (R4,R5) to run OSPF:
- (a) Edit the file
/etc/quagga/zebra.confas
hostname quagga
password networklab
enable password networklab
log stdout
- (b) Edit the file
/etc/quagga/ospf.confas
hostname ospfd
password networklab
enable password networklab
log stdout
- (c) Edit the file
/etc/quagga/daemonsby uncommenting the lines
zebra=yes
ospfd=yes
- (d) Change the permission of the configuration files with
chown quagga.quaggavty /etc/quagga/*.conf
chmod 640 /etc/quagga/*.conf
- (e) Start the routing daemon and login to ospfd process with
/etc/init.d/quagga start
telnet 127.0.0.1 2604
- (f) Configure the ospfd process by adding all the networks to be monitored (10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24). At the ospfd prompt,
ospfd> enable
ospfd# configure terminal
ospfd(config)# router ospf
ospfd(config-router)# network 10.0.0.0/8 area 1
ospfd(config-router)# router-id ___________ #(Set router-id to any one of IP addresses of this router)
ospfd(config-router)# no passive-interface eth0
ospfd(config-router)# redistribute connected
ospfd(config-router)# end
ospfd# show ip ospf database
ospfd# exit
- Configure the Cisco routers (R1, R2, R3) to run OSPF by adding all the networks to be monitored (10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24). For example, at R1,
R1# conf t
R1(config)# no ip domain-lookup
R1(config)# no ip routing
R1(config)# ip routing
R1(config)# no router rip
R1(config)# router ospf 1
R1(config-router)# network 10.0.0.0 0.255.255.255 area 1
R1(config-router)# no passive-interface g0/0
R1(config-router)# no passive-interface g0/1
R1# clear ip route *
R1# show ip ospf database
- Perform traffic capture:
- (a) Start Wireshark at R4 to see the OSPF routing messages that have been exchanged. Wait for a few minutes to let the routing protocol converges. Verify the network connectivity by pinging from R4 to every other interfaces in Fig. 1.
- (b) Look at the routing tables at every node. You should see all destination networks in each routing table.
- (c) Stop and save the Wireshark capture at R4.
- (d) Save the routing tables and OSPF database of all nodes to files.
- Execute traceroute to find a path from R4 to R5. Save the output to a file.
- At R4, start Wireshark to capture packets. Then, ping to R5 and leave it running.
- From the output of traceroute in Step 5:
- (a) If R1 is on the path from R4 to R5, note the system time on R4 with command date and immediately disconnect the cable that connects R1 to 10.0.2.0/24. (b) If R2 is on the path from R4 to R5, note the system time on R4 with command date, and immediately disconnect the cable between R2 and R3. The ping output should now show that the destination is unreachable.
- Wait until OSPF converges, which is indicated by the ping from R4 to R5 being successful again.
- (a) Terminate the ping at R4. Save the ping statistics (shown in the last few lines) and stop the Wireshark capture at R4.
- (b) Save the link state database on every routers with
show ip ospf database
in the ospfd process prompt or Cisco router prompt. All the routers should have the same link state database.
Device-by-Device Lab Procedures
LAB 09 - OSPF (Open Shortest Path First)
1. Workstation 1: R4 (Linux) & R2 (Cisco) Console
- Step 1.1: Connect your network cables to the 10.0.1.0/24 Switch and the top link as shown in the topology. Connect your console cable to R2.
- Step 1.2: Configure IP addresses and OSPF on R2 (Cisco):
R2# conf t
R2(config)# no ip domain-lookup
R2(config)# no ip routing
R2(config)# ip routing
R2(config)# int g0/0
R2(config-if)# ip address 10.0.1.2 255.255.255.0
R2(config-if)# no shut
R2(config-if)# int g0/1
R2(config-if)# ip address 10.0.3.2 255.255.255.0
R2(config-if)# no shut
R2(config-if)# exit
R2(config)# no router rip
R2(config)# router ospf 1
R2(config-router)# network 10.0.0.0 0.255.255.255 area 1
R2(config-router)# no passive-interface g0/0
R2(config-router)# no passive-interface g0/1
R2(config-router)# end
R2# clear ip route *
- Step 1.3: Configure R4 (Linux) interface IP and enable IP forwarding:
ifconfig eth0 10.0.1.4/24 up
echo "1" > /proc/sys/net/ipv4/ip_forward
- Step 1.4: Prepare Quagga/OSPF configuration files on R4:
Edit /etc/quagga/zebra.conf and /etc/quagga/ospfd.conf with the hostnames and passwords as specified in the lab manual.
Uncomment zebra=yes and ospfd=yes in /etc/quagga/daemons.
Fix permissions:
chown quagga.quaggavty /etc/quagga/.conf
chmod 640 /etc/quagga/.conf
- Step 1.5: Start the daemon and configure OSPF on R4:
/etc/init.d/quagga start
telnet 127.0.0.1 2604
ospfd> enable
ospfd# configure terminal
ospfd(config)# router ospf
ospfd(config-router)# network 10.0.0.0/8 area 1
ospfd(config-router)# router-id 10.0.1.4
ospfd(config-router)# no passive-interface eth0
ospfd(config-router)# redistribute connected
ospfd(config-router)# end
-
[WAIT FOR STEP] Wait for Workstation 2 (- Step 2.5) and Workstation 3 (- Step 3.2) to finish their IP and OSPF configurations. Give the routing protocol a few minutes to converge.
-
Step 1.6: Verify the OSPF database and routing table on R2 and R4:
R2# show ip ospf database
R2# show ip route
ospfd# show ip ospf database
(exit telnet to check main Linux routing table)
route -n
- Step 1.7: Start Wireshark on R4 to capture packets.
- Step 1.8: Ping every other interface in Fig 1 to verify connectivity.
- Step 1.9: Execute traceroute to find the path to R5. Save the output.
traceroute 10.0.2.5
-
[WAIT FOR STEP] Coordinate with your group. Based on your traceroute output, determine if the path goes through R1 or R2.
-
Step 1.10: Leave a continuous ping running to R5 (ping 10.0.2.5).
-
Step 1.11 (Link Break Test):
- If R2 is on the path: Note the system time (date), then immediately disconnect the cable between R2 and R3.
- If R1 is on the path: Instruct Workstation 3 to disconnect their cable (- Step 3.4).
-
Step 1.12: Watch the ping output. It should become unreachable, and then succeed again once OSPF converges on the new path.
-
Step 1.13: Stop the ping, save the statistics, stop Wireshark, and save the final show ip ospf database output from R2 and R4.
2. Workstation 2: R5 (Linux) & R3 (Cisco) Console
- Step 2.1: Connect your network cables to the 10.0.2.0/24 Switch and the top link. Connect your console cable to R3.
- Step 2.2: Configure IP addresses and OSPF on R3 (Cisco):
R3# conf t
R3(config)# no ip domain-lookup
R3(config)# no ip routing
R3(config)# ip routing
R3(config)# int g0/0
R3(config-if)# ip address 10.0.2.3 255.255.255.0
R3(config-if)# no shut
R3(config-if)# int g0/1
R3(config-if)# ip address 10.0.3.3 255.255.255.0
R3(config-if)# no shut
R3(config-if)# exit
R3(config)# no router rip
R3(config)# router ospf 1
R3(config-router)# network 10.0.0.0 0.255.255.255 area 1
R3(config-router)# no passive-interface g0/0
R3(config-router)# no passive-interface g0/1
R3(config-router)# end
R3# clear ip route *
- Step 2.3: Configure R5 (Linux) interface IP and enable IP forwarding:
ifconfig eth0 10.0.2.5/24 up
echo "1" > /proc/sys/net/ipv4/ip_forward
- Step 2.4: Prepare Quagga/OSPF configuration files on R5 just like Workstation 1 did, set permissions, and start the daemon.
- Step 2.5: Configure OSPF on R5:
telnet 127.0.0.1 2604
ospfd> enable
ospfd# configure terminal
ospfd(config)# router ospf
ospfd(config-router)# network 10.0.0.0/8 area 1
ospfd(config-router)# router-id 10.0.2.5
ospfd(config-router)# no passive-interface eth0
ospfd(config-router)# redistribute connected
ospfd(config-router)# end
-
[WAIT FOR STEP] Wait for Workstation 1 (- Step 1.5) and Workstation 3 (- Step 3.2) to finish configurations.
-
Step 2.6: Verify the OSPF database and routing table on R3 and R5:
R3# show ip ospf database
R3# show ip route
-
Step 2.7: Save your routing tables and databases to a file.
-
[WAIT FOR STEP] Stand by while Workstation 1 runs traceroutes and performs the link break test (- Step 1.11).
-
Step 2.8: Once the network has reconverged, save the final show ip ospf database on R3 and R5. They should match Workstation 1’s database.
3. Workstation 3: New Linux PC & R1 (Cisco) Console
- Step 3.1: Connect R1’s cables to the 10.0.1.0/24 Switch and the 10.0.2.0/24 Switch. Connect your console cable to R1.
- Step 3.2: Configure IP addresses and OSPF on R1 (Cisco):
R1# conf t
R1(config)# no ip domain-lookup
R1(config)# no ip routing
R1(config)# ip routing
R1(config)# int g0/0
R1(config-if)# ip address 10.0.1.1 255.255.255.0
R1(config-if)# no shut
R1(config-if)# int g0/1
R1(config-if)# ip address 10.0.2.1 255.255.255.0
R1(config-if)# no shut
R1(config-if)# exit
R1(config)# no router rip
R1(config)# router ospf 1
R1(config-router)# network 10.0.0.0 0.255.255.255 area 1
R1(config-router)# no passive-interface g0/0
R1(config-router)# no passive-interface g0/1
R1(config-router)# end
R1# clear ip route *
-
[WAIT FOR STEP] Wait for Workstation 1 (- Step 1.5) and Workstation 2 (- Step 2.5) to finish their configurations and allow OSPF to converge.
-
Step 3.3: Verify your OSPF database and routing table on R1 and save them to a file:
R1# show ip ospf database
R1# show ip route
-
[WAIT FOR STEP] Wait for Workstation 1 to run a traceroute (- Step 1.9). They will tell you if your router (R1) is on the active path.
-
Step 3.4 (Link Break Test):
- If Workstation 1 tells you R1 is on the path, wait for their signal, then immediately disconnect the cable that connects R1 to the 10.0.2.0/24 network (g0/1).
-
Step 3.5: Wait for Workstation 1 to confirm OSPF has converged on the backup path (- Step 1.12).
-
Step 3.6: Re-run and save the final show ip ospf database on R1.