Linux is the solution to many problems. For example, basic networking. After a bit of research and self-affirmation, I found a handful of resources online reminding me it is possible to develop a network of Linux-based computers configured for traditional routing (RIP, OSPF, BGP, etc.). Below is Part 1 of what will possibly be an on-going series for this project.

Perform initial setup

First we need to enable packet forwarding (we’re appending the option to the system .conf file).

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf # enable option
sysctl -p # load option

I’ll explain later, but you will need to download Quagga from the Debian jessie repo (an older one). This requires specifically adding the repo, downloading metadata about it, and then, forcing your package manager to use it (along with an additional library called libreadline6).

echo "deb http://ftp.us.debian.org/debian jessie main" >> /etc/apt/sources.list
apt-get update # downloads updates from the jessie repo
apt-get install -t jessie quagga libreadline6

Verify the installation was succcessful

Again, I’ll explain later in a follow-on post, but having these three files indicate you’re on track thus far (if not you’ll need to address the package version you installed).

ls /etc/quagga/ # expected output: daemons & debian.conf
ls /etc/init.d/quagga # a script for starting the correct daemons 

Copy template configuration files for desired protocols

Depending on your intended set-up, you may need or want to copy over more .conf files. Yet, I am only going to focus on getting OSPF working for this network.

cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf
cp /usr/share/doc/quagga/examples/vtysh.conf.sample /etc/quagga/vtysh.conf
chown quagga.quaggavty /etc/quagga/*.conf
chmod 640 /etc/quagga/*.conf

Create a backup of important files

cp /etc/quagga/daemons /etc/quagga/daemons.bak
cp /etc/quagga/debian.conf /etc/quagga/debian.conf.bak
cp /etc/quagga/zebra.conf /etc/quagga/zebra.conf.bak
cp /etc/quagga/ospfd.conf /etc/quagga/ospfd.conf.bak 
cp /etc/quagga/vtysh.conf /etc/quagga/vtysh.conf.bak 

Edit the debian.conf file

It’s my personal preference to comment-out options as opposed to out-right deleting them.

vtysh_enable=yes # verify this is enabled (set to 'yes')
#zebra_options="  --daemon -A 127.0.0.1" # disabled for historical reference
zebra_options=" --daemon " 

Start Quagga

update-rc.d quagga enable
service quagga start
service quagga status

Stay tuned, smash that Like button, and subscr- oh wait, wrong medium.
I’ll publish the next post soon.

References