Quagga is a software suite that implement multiprotocol routing support (OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng and BGP-4). The zebra daemon is the core of quagga that manage the interaction of kernel routing table and the daemons for individual routing protocols. Each daemon has its own config file in /etc/quagga directory.
I’ll configure two Routers with FreeBSD 9.0 running RIPv2 with key authentication, sharing the routing tables of local networks between the two routers. This is my network:
# cd /usr/ports/net/quagga && make install clean
2.- Edit /etc/rc.conf :
quagga_enable="YES" quagga_daemons="zebra ripd" gateway_enable="YES"
3.- Setting up package forwarding:
# sysctl -w net.inet.ip.forwarding=1
4.- Copy config example files:
# cp /usr/local/share/examples/quagga/zebra.conf.sample /usr/local/etc/quagga/zebra.conf # cp /usr/local/share/examples/quagga/ripd.conf.sample /usr/local/etc/quagga/ripd.conf
5.- Starting quagga:
# /usr/local/etc/rc.d/quagga start
– Check the port number 2601 (zebra) and 2602 (ripd) are listening by the server:
6.- Login to the zebra vty to setting up the interfaces:
- Router 1:
# telnet localhost 2601 User Access Verification Password: Router> enable Password: Router# config term Router(config)# interface em0 Router(config-if)# ip address 192.168.0.20/24 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# interface em1 Router(config-if)# ip address 172.16.1.1/24 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# hostname quagga01 quagga01(config)# write Configuration saved to /usr/local/etc/quagga/zebra.conf
- Router 2:
# telnet localhost 2601 User Access Verification Password: Router> enable Password: Router# config term Router(config)# interface em0 Router(config-if)# ip address 192.168.0.21/24 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# interface em1 Router(config-if)# ip address 172.16.2.1/24 Router(config-if)# no shutdown Router(config-if)# exit Router(config)# hostname quagga02 quagga02(config)# write Configuration saved to /usr/local/etc/quagga/zebra.conf
7.- Login to the ripd vty to setting up the RIP routing protocol:
- Router 1:
# telnet localhost 2602 User Access Verification Password: ripd> enable ripd# config term ripd(config)# router rip ripd(config-router)# version 2 ripd(config-router)# network 192.168.0.0/24 ripd(config-router)# network 172.16.1.0/24 ripd(config-router)# passive-interface em1 ripd(config-router)# exit ripd(config)# key chain mykey1 ripd(config-keychain)# key 1 ripd(config-keychain-key)# key-string quagga ripd(config-keychain-key)# exit ripd(config-keychain)# exit ripd(config)# interface em0 ripd(config-if)# ip rip authentication key-chain mykey1 ripd(config-if)# ip rip authentication mode md5 ripd(config-if)# exit ripd(config)# write Configuration saved to /usr/local/etc/quagga/ripd.conf
- Router 2:
# telnet localhost 2602 User Access Verification Password: ripd> enable ripd# config term ripd(config)# router rip ripd(config-router)# version 2 ripd(config-router)# network 192.168.0.0/24 ripd(config-router)# network 172.16.2.0/24 ripd(config-router)# passive-interface em1 ripd(config-router)# exit ripd(config)# key chain mykey1 ripd(config-keychain)# key 1 ripd(config-keychain-key)# key-string quagga ripd(config-keychain-key)# exit ripd(config-keychain)# exit ripd(config)# interface em0 ripd(config-if)# ip rip authentication key-chain mykey1 ripd(config-if)# ip rip authentication mode md5 ripd(config-if)# exit ripd(config)# write Configuration saved to /usr/local/etc/quagga/ripd.conf
- See the routing tables:
Router 1:
# telnet localhost 2601 User Access Verification Password: quagga01> enable Password: quagga01# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, A - Babel, > - selected route, * - FIB route
C>* 127.0.0.0/8 is directly connected, lo0 C>* 172.16.1.0/24 is directly connected, em1 R>* 172.16.2.0/24 [120/2] via 192.168.0.21, em0, 00:03:29 C>* 192.168.0.0/24 is directly connected, em0 quagga01# exit Connection closed by foreign host.
Router 2:
# telnet localhost 2601 User Access Verification Password: quagga02> enable Password: quagga02# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, A - Babel, > - selected route, * - FIB route
C>* 127.0.0.0/8 is directly connected, lo0 R>* 172.16.1.0/24 [120/2] via 192.168.0.20, em0, 00:06:06 C>* 172.16.2.0/24 is directly connected, em1 C>* 192.168.0.0/24 is directly connected, em0 quagga02# exit Connection closed by foreign host.
- Official wiki main page of Quagga project:
http://sourceforge.net/apps/mediawiki/quagga/index.php?title=Main_Page