Experimenting with Intradomain Routing Protocols
Introduction
This is to provide hands-on experience on Internet intradomain routing protocols. There are a few implementations of routing protocols on Linux systems. We work on a few simple examples here to get hands-on experiences on intradomain routing. The main references for these exercises is Section 10.5 Dynamic Routing in the Debian Administrator’s Handbook, which in turn references to Quagga.
Setting an Internetowrk
To begin, we need to set up an internetwork and assign IP addresses to the devices on the internetwork network. We can use either of the “diamond IPv4 network”, the “linear ipv4 network”, the “diamond IPv6 network”, and the “linear ipv6 network” we set up or experimented before.
Setting up Dynamic Routing for IPv4
Enabling IPv4 Forwarding
For each host, enable IPv4 forwarding,
$ sudo sysctl -w net.ipv4.ip_forward=1
or add or uncomment the following line in /etc/sysctl.conf
net.ipv4.ip_forward=1
Installing OSPF for IPv4
First, we need to install the OSPF (Open Shortest Path First) daemon. For each host, run the following command,
$ sudo apt-get install --no-install-recommends quagga-ospfd
which installs quagga-ospfd and its dependency quagga-core.
Configuring OSPF for IPv4
We will create two configuration files. However, it can be beneficial by examining the examples of the configuration files in the Linux system. The files have comments and may help you understand the configuration. The example configuration files are,
/usr/share/doc/quagga-core/examples/zebra.conf.sample
/usr/share/doc/quagga-core/examples/ospfd.conf.sample
For each host, we create these two configuration files. For instance, on host midwood, the two configuration files we create are,
/etc/quagga/zebra.conf
whose content is given in this Linux command,# cat zebra.conf hostname midwood password zebra enable password zebra log file /var/log/quagga/zebra.log #
/etc/quagga/ospfd.conf
whose content is given in this Linux command,# cat ospfd.conf hostname midwood log file /var/log/quagga/ospfd.log router ospf ospf router-id 10.1.1.1 network 10.1.1.1/28 area 0.0.0.0 network 10.1.1.17/28 area 0.0.0.0 access-list localhost permit 127.0.0.1/32 access-list localhost deny any line vty access-class localhost
We will need to create these two files for each host, and make adjustment.
Starting Zebra Daemon
For each host,
sudo systemctl start zebra
Starting OSPF Daemon
For each host,
sudo systemctl start ospfd
Routing Tables
For example, the following is an example of the routing table on host EastNY,
$ ip route
default via 10.0.2.2 dev enp0s3
10.0.2.0/24 dev enp0s3 proto kernel scope link src 10.0.2.15
10.1.1.0/28 via 10.1.1.33 dev enp0s9 proto zebra metric 20
10.1.1.16/28 via 10.1.1.33 dev enp0s9 proto zebra metric 20
10.1.1.32/28 dev enp0s9 proto kernel scope link src 10.1.1.34
10.1.1.48/28 dev enp0s10 proto kernel scope link src 10.1.1.50
192.168.56.0/24 dev enp0s8 proto kernel scope link src 192.168.56.3
$
where two routes were added by OSPF via Zebra.
Exercise and Exploration
- Repeat the above experiment.
- Design a packet capture experiment to examine packets transmitted by OSPF
- Display the routing table before and after you show down a host along a path
Exercise and Exploration
- Set up the RIC proposal, observe message exchanged and routing tables