OpenWRT: quagga

From OnnoWiki
Revision as of 07:37, 15 November 2018 by Onnowpurbo (talk | contribs)
Jump to navigation Jump to search

sumber: https://openmaniak.com/quagga_tutorial.php


1. QUAGGA DAEMONS:

You have to activate the Quagga daemons matching the routing protocols you want to set on your router. zebra: bgpd: ospfd: ospf6d: ripd: ripngd: Interface declaration and static routing BGP routing protocol OSPF routing protocol OSPF IPv6 routing protocol RIP v2 routing protocol RIP Ipv6 routing protocol In the example below, the zebra and IPv4 OSPF daemon have been activated.

  1. vim /etc/quagga/daemons

zebra=yes bgpd=no ospfd=yes ospf6d=no ripd=no ripngd=no

Restart the Quagga service:

  1. /etc/init.d/quagga restart

Stopping Quagga daemons (prio:0): ospfd zebra (bgpd) (ripd) (ripngd) (ospf6d) (isisd). Removing all routes made by zebra. Nothing to flush. Loading capability module if not yet done. Starting Quagga daemons (prio:10): zebra ospfd.

You can check the Quagga daemons status:

  1. ps -ef | grep quagga

UID PID PPID C STIME TTY TIME CMD quagga 4632 1 0 22:25 ? 00:00:00 /usr/lib/quagga/ospfd --daemon quagga 4636 1 0 22:25 ? 00:00:00 /usr/lib/quagga/zebra --daemon If a Quagga daemon doesn't stop properly, you can kill it manually and start the quagga service:

  1. kill -9 "UID number"
  2. /etc/init.d/quagga start


2. CONFIGURATION FILES: (/etc/quagga/*.conf files)

You must create a configuration file (even if it is empty) each time you activate a Quagga daemon. Each daemon is associated with a specific file name:

zebra: bgpd: ospfd: ospf6d: ripd: ripngd: zebra.conf bgpd.conf ospfd.conf ospf6d.conf ripd.conf ripngd.conf To create the config files, copy the sample config files as follows: In our example, as we activated the zebra and ospfd daemons; we need to create the zebra.conf and ospfd.conf files.

  1. cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf
  2. cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf

Another way to do it is to create two empty files called /etc/quagga/ospfd.conf and /etc/quagga/zebra.conf. But in this case you cannot telnet a daemon, you need to configure the telnet permissions with vtsh (see below).

Finally, give user and group ownership to respectively quagga and quaggavty to the files inside the /etc/quagga directory:

  1. chown quagga.quaggavty /etc/quagga/*.conf
  2. chmod 640 /etc/quagga/*.conf

Restart the Quagga service:

  1. /etc/init.d/quagga restart


The sample configuration shown below is for the Jandakot node on the WAFreeNet. This node uses a WRT54G running OpenWrt as a router, and the WRT provides routing, dns, dhcp and firewalling services for the node. Jandakot has an uplink to the ArmadaleAP node, and Willetton has a client link to Jandakot.


Install Components on OpenWrt Install IPK Packages Install the appropriate Quagga packages on OpenWrt:

ipkg install quagga quagga-bgpd


Note that this assumes your WRT has internet access, and is able to download the package list to determine where it needs to download the specified packages. If your WRT doesn't have internet access, you'll need to use a browser to view the package list list, manually download the specified packages, and transfer them to your WRT and install them.


Create Configuration Files Firstly, create a directory for all Quagga configuration files on the WRT:

 mkdir /etc/quagga


Create a configuration file for the Quagga zebra daemon, /etc/quagga/zebra.conf:

 hostname jandakot
 ! define password for bgpd daemon (for connecting to daemon via telnet)
 password insertpasswordhere
 ! define enable password for bgpd daemon (for connecting to daemon via telnet)
 enable password insertpasswordhere
 !
 ! list interfaces
 interface eth1
 interface vlan0
 interface vlan1
 interface lo
 !
 ! null route to consolidate all subnets in this /24
 ip route 10.60.86.0/24 Null0 255
 !
 line vty


The null route allows us to consolidate all routes for the /24 subnet that this router is responsible for, and will cause it to propagate a single route for the entire /24 subnet, rather than multiple routes for the smaller subnets inside 10.60.86.0/24.


Referensi

Pranala Menarik