• Setting up Quagga suite of dynamic routing protocols

    by  • February 12, 2010 • linux, networking, quagga, routing • 0 Comments

    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

    1. wget http://www.quagga.net/download/quagga-0.98.6.tar.gz
    2. 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.

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

    Create quagga directory in /var/run

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

    1. mkdir /var/run/quagga

    Create quagga user and group

    1. groupadd quagga
    2. useradd –g quagga quagga
    3. 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

    1. chgrp quagga /var/run/quagga
    2. chgrp quagga /usr/local/etc/quagga
    3. chown -R quagga /var/run/quagga
    4. chown –R quagga /usr/local/etc/quagga

    Create zebra configuration file

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

    1. 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!

    About

    .NET developer at thetrainline.com, previously web developer at MRM Meteorite. Awarded a PhD in misbehaviour detection in wireless ad-hoc networks.A keen C# ASP.net developer bridging the gap with APIs and JavaScript frameworks, one web app at a time.

    http://www.paulkiddie.com

    Leave a Reply

    Your email address will not be published. Required fields are marked *