Tuesday, November 19, 2013

[Quagga] How to compile and install Quagga on Ubuntu 12.04

The following steps are the compilation and installation for Quagga on Ubuntu 12.04. Hopefully it is helpful for you.
  • Install all dependency(package) 
    • sudo apt-get build-dep quagga
  • Give the path for all configurations files and libraries used by quagga for starting. I use this one /opt/quagga .... and this is done by this comand: 
    • ./configure --enable-vtysh --prefix=/opt/quagga --localstatedir=/opt/quagga sysconfdir=/opt/quagga 
  • Create new folder: 
    • sudo mkdir /opt/quagga
  • Add new user : 
    • sudo adduser quagga 
  • Give the priviledge for the user quagga over the folder: /opt/quagga and for the folders and subfolders you give the privilegde for all rights : reading, changing and executing
    • sudo chown quagga:quagga /opt/quagga
    • sudo chmod 777 /opt/quagga 
  • Then you will be able to comiple Quagga: 
    • make
    • sudo make install 
Quagga configuration
--------------------
quagga version          : 0.99.22
host operating system   : linux-gnu
source code location    : .
compiler                : gcc
compiler flags          : -Os -fno-omit-frame-pointer -g -std=gnu99 -Wall -Wsign-compare -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcast-qual
make                    : make
includes                : 
linker flags            :  -lcrypt   -lrt -lcap  -lm
state file directory    : /opt/quagga
config file directory   : /opt/quagga
example directory       : /opt/quagga
user to run as  : quagga
group to run as  : quagga
group for vty sockets : 
config file mask        : 0600
log file mask           : 0600

Now, let us try Quagga for some examples
  • Zebra
    • Copy sample to conf file:
      • cd /opt/quagga
      • cp zebra.conf.sample zebra.conf
    • Start zebra daemon, you use this command 
      • sudo /opt/quagga/sbin/zebra &
    • Check the daemon zebra:
      • netstat -a | grep zebra 
    • Get into the zebra, you use 
      • telnet localhost zebra
  • BGP
    • Copy sample to conf file:
      • cd /opt/quagga
      • cp bgpd.conf.sample bgpd.conf
    • Start bgpd: 
      • sudo /opt/quagga/sbin/bgpd &
    • Check the daemon zebra:
      • netstat -a | grep bgpd
    • Get into the bgpd, you use 
      • telnet localhost bgpd
  • vtysh
    • cd /opt/quagga
    • vi /opt/quagga/vtysh.conf
    • sudo /opt/quagga/bin/vtysh
! Sample configuration file for vtysh. ! !service integrated-vtysh-config hostname quagga-router username root nopassword !
Stop Quagga Daemon ( for example: bgpd ):
  • sudo kill `cat /opt/quagga/bgpd.pid`
Port Number:

  • zebra: 2601
  • ripd:  2602
  • ripng: 2603
  • ospfd: 2604
  • bgpd:  2605
  • ospf6d: 2606



3 comments:

Unknown said...

Still seems valid for the 16.04 when compiling from source, thanks!

TeYen (Danny) said...

That's great. Thanks for your feedback.

Unknown said...

How install systen service for auto start?
i am using ubuntu 17.10 quagga 1.22