Quagga is a route server which supports BGP, OSPF and RIP.
First I need to enable the routing protocol daemons I need.
Here’s the configuration file of quagga daemon:
# This file tells the quagga package which daemons to start. # # Entries are in the format: =(yes|no|priority) # 0, "no" = disabled # 1, "yes" = highest priority # 2 .. 10 = lower priorities # Read /usr/share/doc/quagga/README.Debian for details. # # Sample configurations for these daemons can be found in # /usr/share/doc/quagga/examples/. # # ATTENTION: # # When activation a daemon at the first time, a config file, even if it is # empty, has to be present *and* be owned by the user and group "quagga", else # the daemon will not be started by /etc/init.d/quagga. The permissions should # be u=rw,g=r,o=. # When using "vtysh" such a config file is also needed. It should be owned by # group "quaggavty" and set to ug=rw,o= though. Check /etc/pam.d/quagga, too. # zebra=yes bgpd=yes ospfd=yes ospf6d=no ripd=no ripngd=no isisd=no
Zebra is needed for doing static routes, bgp and ospf are dynamic protocols which I need for lab later. I was surprise quagga supports IS-IS as well…:)
Create config files for the routing protocol daemons which I wanted to turn on, I could either create an empty config file for each routing protocol daemons or copy sample config from:
cat /usr/share/doc/quagga/examples/ bgpd.conf.sample isisd.conf.sample ospfd.conf.sample ripngd.conf.sample zebra.conf.sample bgpd.conf.sample2 ospf6d.conf.sample ripd.conf.sample vtysh.conf.sample
Each sample config contains some basic command line configuration for the routing protocols.
To use the sample config:
sudo cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf sudo cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf sudo cp /usr/share/doc/quagga/examples/bgpd.conf.sample /etc/quagga/bgpd.conf
To create my empty config files for the selected routing protocol daemons:
sudo touch /etc/quagga/ospfd.conf sudo touch /etc/quagga/bgpd.conf sudo touch /etc/quagga/zebra.conf
Then I need to change the owner and permission of the config files, the /etc/quagga/daemons file recommended to use user mode 640.
sudo chown quagga:quaggavty /etc/quagga/*.conf sudo chmod 640 /etc/quagga/*.conf
Start or restart the quagga daemon.
sudo /etc/init.d/quagga restart Stopping Quagga daemons (prio:0): (waiting) .. bgpd ospfd (zebra) (ripd) (ripngd) (ospf6d) (isisd). Removing all routes made by zebra. Loading capability module if not yet done. Starting Quagga daemons (prio:10): zebra bgpd ospfd.
If no config files are created for the selected routing protocol daemons, quagga will never start, here’s the sample output when no config files was created or found.
/etc/init.d/quagga start Loading capability module if not yet done. Starting Quagga daemons (prio:10): zebra (not started without config file) bgpd (not started without config file) ospfd (not started without config file).
The empty config files for zebra, ospf and bgp has to have vty password, insert this line
password quagga or any password of your choice.
To start ospf
telnet localhost ospfd.
To start bgp
telnet localhost bgpd.
To start zebra
telnet localhost zebra
Make sure that the owner is quagga and the group is quaggavty for /etc/quagga and /etc/quagga/*.conf, if the user is not quagga you cannot save the configuration due to permission problem.