How to Configure Quagga Routing Suite on Linux

February 22, 2016 | By in NETWORK, UBUNTU HOWTO
| Reply More

Quagga is one of the core open source project which is used to provide routing services on linux platform. It consist of different components for different dynamics protocols such as  Open Shortest Path First (OSPF),  Routing Information Protocol  (RIP), Border Gateway Protocol (BGP), Intermediate System to Intermediate System (IS-IS) and Multiprotocol Label Switching (MPLS). Partially it provides the same virtual terminal or CLI (vty/vtysh) like CISCO/JUNIPER for the configuration of protocols.

In this article, we will install Quagga routing suite on Ubuntu platform. Details of our VM is shown below.



Quagga can be installed from source code however, in this article we will install deb/binary package.

Run below command to check dependencies of Qugaaga package.

#apt-cache depends quagga

Output of the above command is shown below.

quagga dependencies

Run following command to install Qugaaga routing software.

#apt-get install quagga

Quagga package installation is shown in following figure.



Default configuration of linux based devices does not support packet forwarding until enable few kernel  parameters.

Enable packet forwarding for IPv4 using following commands which is shown in figure.   Setting will be permanently saved in /etc/sysctl.conf file.

$echo "net.ipv4.conf.all.forwarding=1" | sudo tee -a /etc/sysctl.conf
$echo "net.ipv4.conf.default.forwarding=1" | sudo tee -a /etc/sysctl.conf
$sudo sysctl -p

kernel setting

After enabling packet forward, now we will configure Quagga routing software to run on linux.  Following configuration required to run Quagga daemon on Ubuntu.


User can create these configuration files or copy these sample files from /usr/share/doc/quagga/examples/ path to /etc/quagga/*.conf path.


Copying sample files under /etc/quagga/ path is shown in following figure.

sample file copy

Rename samples files after copying in /etc/quagga directory.

test@test-machine:/etc/quagga$ sudo mv babeld.conf.sample babeld.conf
test@test-machine:/etc/quagga$ sudo mv isisd.conf.sample isisd.conf
test@test-machine:/etc/quagga$ sudo mv ospfd.conf.sample ospfd.conf
test@test-machine:/etc/quagga$ sudo mv ripngd.conf.sample ripngd.conf
test@test-machine:/etc/quagga$ sudo mv zebra.conf.sample zebra.conf
test@test-machine:/etc/quagga$ sudo mv bgpd.conf.sample bgpd.conf
test@test-machine:/etc/quagga$ sudo mv ospf6d.conf.sample ospf6d.conf
test@test-machine:/etc/quagga$ sudo mv ripd.conf.sample ripd.conf
test@test-machine:/etc/quagga$ sudo mv vtysh.conf.sample vtysh.conf

conf files

Quagga daemon run under user quagga therefore change the ownership and permission for configuration files. User quagga is created in Ubuntu during package installation.

quagga user

Run following commands under /etc/quagga folder to change owner ship and permission.

$sudo chown quagga:quagga *

quagga user and group

Permission "640" is already set on the files.

In the end, we have to enable or disable different daemons of Quagga.  Zebra daemon is the core part of  routing suite so it must be enabled in /etc/quagga/daemons file. In this article, only OSPF and RIP dynamic protocol daemons are enabled in the file.

Default configuration of daemons file is shown in the following snapshot. All routing daemons are disabled in the default configuration file.

daemons file

Configuration file with OSPF and RIP enabled is shown below.

our qugga daemons

Different daemons of Quagga suite will run on TCP protocol and listening ports will be from 2600-2800.

test@test-machine:/etc/quagga$ cat /etc/services | grep zebra

zebrasrv       2600/tcp      # zebra service
zebra             2601/tcp      # zebra vty
ripd               2602/tcp      # ripd vty (zebra)
ripngd           2603/tcp      # ripngd vty (zebra)
ospfd             2604/tcp      # ospfd vty (zebra)
bgpd              2605/tcp      # bgpd vty (zebra)
ospf6d           2606/tcp      # ospf6d vty (zebra)
isisd               2608/tcp     # ISISd vty (zebra)

Start Quagga routing suite using following command.

$sudo /etc/init.d/quagga restart

quagga starting

Using netstat command, we can confirm successful running of daemons.

$sudo netstat -antp | grep 260


Quagga routing can be configured using following ways.


telnet (telnet ospfd/ripd/bgpd/zebra)

vtysh provides single place for the configuration of all daemons. Type following command in terminal to start virtual shell (vtysh) for Quagga configuration

$sudo vtysh


Zebra, ospfd and ripd can be configured using vtysh.

available daemons in vtysh

Daemons configuration using telnet command is shown in following figures.

Zebra daemon

$telnet localhost zebra

zebra telnet

Ospfd daemon

$telnet localhost ospfd

telnet ospfd

Ripd daemon

$telnet localhost ripd



Quagga routing suite is mostly used on linux platform to perform dynamic routing. In this article, we learned installation, configuration and usage of Quagga routing suite. It supports multiple ways to configure routing protocols such as OSPF and RIP.  Quagga based routing devices can be used for small and medium enterprises (SME).


Share This :

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.