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


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,

  1. /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
  2. /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
     network area
     network area
    access-list localhost permit
    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 dev enp0s3 dev enp0s3 proto kernel scope link src via dev enp0s9 proto zebra metric 20 via dev enp0s9 proto zebra metric 20 dev enp0s9 proto kernel scope link src dev enp0s10 proto kernel scope link src dev enp0s8 proto kernel scope link src

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