Paul Kiddie

Setting up Quagga suite of dynamic routing protocols

February 12, 2010

Quagga is a suite of dynamic routing protocols for Unix based systems and is a fork of GNU Zebra, which seems to be discontinued.

I attempted to follow the documentation but some steps seemed to be assumed so here is what I did to get it up and running on my Ubuntu 8.04 system – it should work on the majority of Linux distributions though…

I’m working with the latest stable release of quagga, currently at 0.98.6.

Download quagga

tar -xvvf quagga-0.98.6.tar.gz

Set up quagga

I have customised the default directories quagga as it will help with managing permissions later. You need to be a superuser to install and run quagga initially, but when running, quagga will drop down to a least-privilege user (by default, called quagga). This user can be customised, and you should check out the Quagga documentation for the full range of configuration switches.

cd quagga-0.98.6
./configure –localstatedir=/var/run/quagga –sysconfdir=/usr/local/etc/quagga
sudo su
make install

Create quagga directory in /var/run

This folder is used when quagga runs to store pid’s etc.

mkdir /var/run/quagga

Create quagga user and group

groupadd quagga
useradd –g quagga quagga
id quagga

* the id command shows you the groups that quagga belongs to: check the quagga user is in the quagga group.

Set up file/folder permissions for quagga user

chgrp quagga /var/run/quagga
chgrp quagga /usr/local/etc/quagga
chown -R quagga /var/run/quagga
chown –R quagga /usr/local/etc/quagga

Create zebra configuration file

For simplicity, I’ll just copy the sample configuration file…

cp /usr/local/etc/quagga/zebra.conf.sample /usr/local/etc/quagga/zebra.conf

Running Quagga

  1. Ensure /etc/services lists zebra and the numerous dynamic routing protocol ports as part of the Quagga suite by inserting the protocol bindings at Section 2.3 of the Quagga documentation and adding them if they don’t exist.
  2. As the root user type zebra –d. This will run zebra in daemon mode without any errors.
  3. Exit out of superuser mode.
  4. To check zebra is running correctly, we’ll now telnet into the, zebra VTY by typing telnet localhost 2601, which should present a hello message from Quagga with a CLI for managment purposes. The password specified in zebra.conf is used, which is zebra by default.

To get any use out of Quagga, you’ll need to run one of the routing daemons included, such as ripd. I’ll leave this to another article. In any case, you need to make sure zebra has been invoked first. For this to work make sure you have created/copied the relevant configuration file within /usr/local/etc/quagga. For ripd, the configuration file that needs to be present in this folder is ripd.conf.

Hope this helps someone!

👋 I'm Paul Kiddie, a software engineer working in London. I'm currently working as a Principal Engineer at trainline.