B2206021 DangNhatTuong CT106H Lab3
B2206021 DangNhatTuong CT106H Lab3
B2206021 DangNhatTuong CT106H Lab3
Submission: an ID_NAME_Lab03.pdf file describes clearly how did you solve the problem
Exercise 0: change the directory to your home directory
Answer: $cd
Exercise 12: Construct a simple topology
Answer:
Create exercises12 directory
$ mkdir -p ~/CT106H/lab3/exercises12
$ cd ~/CT106H/lab3/exercises12
!
hostname ripd
password zebra
enable password zebra
!
This section handles the identification of the RIP daemon and basic security through
password protection, ensuring that only authenticated users can configure the RIP
service
!
router rip
redistribute connected
network eth0
network eth1
!
This section defines how the router interacts with other devices using the RIP protocol,
including which interfaces participate in routing and what information (connected
routes) should be shared
log file /var/log/quagga/ripd.log: this command sets the location where the RIP
daemon will logs its events and activities
Start the lab
$ kathara lstart
Testing connectivity
$ route -n (On r1 r2 r3)
$ ping -c 2 100.0.0.1 (r3 ping to eth0 r1)
’
⇒ Routing protocols (RIP, OSPF) can detect and update route in the routing table
automatically
On a router, use the command tcpdump to capture the RIPv2 packet; then stop the
command after about 20 seconds. For example, on r1 type: tcpdump -i any -w
/shared/Ex12_r1.pcap
On a router, connecting to the main zebra daemon using the following command:
telnet localhost ripd
The password is zebra
Open the file Ex12_r1.pcap using Wireshark, select the RIPv2 packet, explain
information in that packet.
traceroute 100.1.2.1 command trace the path that data packets take from your computer to the
destination IP address 100.1.2.1. In this process, 100.1.0.13 represents the next hop from R4 on
the way to the final destination, which is 100.1.2.1.
On R1, shutting down an interface using the command ifconfig eth1 down and
Examine the route using the command traceroute 100.1.0.10
# traceroute 100.1.0.10 (before)
# ifconfig eth1 down
# traceroute 100.1.0.10 (after)
Before the shutdown, the traceroute shows that the track from r1 to the IP address
100.1.0.10 is just only 1 hop. After shutting down the interface, the destination was still
reachable but in two hops, also the latency values changed, indicating a different route
or path was used after eth1 went down.
Answer:
Create exercises14 directory
$ mkdir -p ~/CT106H/lab3/exercises14
$ cd ~/CT106H/lab3/exercises14
Prepare the lab
$ mkdir bb0/etc/quagga bb1/etc/quagga bb2/etc/quagga bb3/etc/quagga
bb5/etc/quagga shared
$ gedit lab.conf
$ gedit bb0.startup
$ gedit bb1.startup
$ gedit bb2.startup
$ gedit bb3.startup
$ gedit bb4.startup
$ gedit bb0/etc/quagga/daemons
$ gedit bb0/etc/quagga/ospfd.conf
$ gedit bb1/etc/quagga/daemons
$ gedit bb1/etc/quagga/ospfd.conf
$ gedit bb2/etc/quagga/daemons
$ gedit bb2/etc/quagga/ospfd.conf
$ gedit bb3/etc/quagga/daemons
$ gedit bb3/etc/quagga/ospfd.conf
$ gedit bb4/etc/quagga/daemons
$ gedit bb4/etc/quagga/ospfd.conf
The file represents the configuration of the OSPF (Open Shortest Path First) routing
protocol on a router
interface eth1: Refers to the Ethernet interface eth1.
ospf cost 45: Sets the OSPF cost for this interface to 45. This cost determines the metric
for routing decisions—lower cost paths are preferred.
router ospf: Starts the OSPF routing process.
network 10.0.0.0/16 area 0.0.0.0: This command tells OSPF to include all interfaces
within the 10.0.0.0/16 network in Area 0, which is the backbone area in OSPF.
redistribute connected: Redistributes directly connected routes into OSPF, meaning any
networks directly connected to this router will be advertised in OSPF.
Start the lab
$ kathara lstart
Testing connectivity
# route -n ( On bb0 bb1 bb2 bb3 bb4)
# ping -c 2 10.0.2.1 ( bb1 ping to eth0 bb4)
# ping -c 2 10.0.0.3 ( bb2 ping to eth0 bb0)
Perform a traceroute –I from bb1 to 10.0.2.1
◼ what path is the traceroute expected to take?
◼ what path are ICMP replies expected to take?
# traceroute -I 10.0.2.1 (the -I option specifies that the traceroute should use ICMP
(Internet Control Message Protocol) echo requests instead of the default UDP (User
Datagram Protocol) packets)
show ip ospf database: Displays information about the OSPF link-state database
(LSDB), which contains all the link-state advertisements (LSAs) used by OSPF to create
the network routing topology.
show ip ospf neighbor: Displays information about the OSPF neighbors with which the
router has formed adjacencies.
Access the ospfd cli on the various routers and issue the following commands:
◼ show ip ospf interface: Dísplays information about OSPF settings for different
interfaces on the router.
Exercise 15 (ospf-multiarea)
Answer:
Answer:
Create exercises16 directory
$ mkdir -p ~/CT106H/lab3/exercises16
$ cd ~/CT106H/lab3/exercises16
Prepare the lab
$ mkdir router1/etc/quagga router2/etc/quagga router3/etc/quagga shared
$ gedit lab.conf
$ gedit pc2.startup
$ gedit pc3.startup
$ gedit router1.startup
$ gedit router2.startup
$ gedit router3.startup
$ gedit routerisp.startup
$ gedit router1/etc/quagga/daemons
$ gedit router1/etc/quagga/ripd.conf
$ gedit router1/etc/quagga/zebra.conf
$ gedit router2/etc/quagga/daemons
$ gedit router2/etc/quagga/ripd.conf
$ gedit router2/etc/quagga/zebra.conf
$ gedit router3/etc/quagga/daemons
$ gedit router3/etc/quagga/ripd.conf
$ gedit router3/etc/quagga/zebra.conf
Start the lab
$ kathara lstart
Testing connectivity
# route -n (On router1 router2 router3)
# ping -c 2 192.168.2.111 (pc2 ping to eth0 pc3)
# ping -c 2 10.0.1.5 (pc2 ping to eth2 router1)
# ping -c 2 192.168.1.200 (pc3 ping to eth0 pc2)
# ping -c 2 10.0.1.9 (pc3 ping to eth2 router2)