File:  [NetBSD Developer Wiki] / wikisrc / quagga.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Mon Nov 21 03:22:58 2011 UTC (2 years, 4 months ago) by mspo
Branches: MAIN
CVS tags: HEAD
finish importing the pages from my findings in the pkgsrc.se wiki

#quagga

Quagga is a routing software package which supports following protocols: RIP, OSPF, BGP, IPv4, IPv6, etc.

NetBSD provides network configuration through *ifconfig, route, netstat, *etc.

In the alternative Quagga also can setup interface's, addresses, flags, routes and so on. Quagga provides and handles the alternative networking options. Quagga can be in use for single xDSL connection, small network configuration and to set-up backbone routers for really large network.

Very often Quagga in use together with NetBSD networking. NetBSD serves interfaces and Quagga serves routing.

Traditionally ISP's uses Quagga for RIP, OSPF and BGP routing. 

**Contents**

[[!toc]]

#Installation

To install Quagga Routing Suite do:

    # cd /usr/pkgsrc/net/quagga
    # make install

Configuration files located at */usr/pkg/etc/zebra*.

To run quagga during machine start you can add into *rc.local* file following:

    mkdir /var/run/zebra
    chown quagga /var/run/zebra
    chgrp quagga /var/run/zebra
    /usr/pkg/sbin/zebra -d
    /usr/pkg/sbin/bgpd -d

Put in */usr/pkg/etc/zebra/zebra.conf* following:

    hostname yourhostname
    password yourpassword
    enable password yourpassword

Log files located at: */var/log/quagga/*. 

#Interfaces

If you need to define **lo** put the following in */usr/pkg/etc/zebra/zebra.conf*, for an example:

    interface lo
    ip address 127.0.0.1/8 
    ip address A.B.C.D/32 (this is your host real IP address)

To enable network interfaces put for an example:

    interface rtk0
    ip address 192.168.170.201/24
    multicast

*Note*. This is alternative way to setup network interfaces instead of /etc/ifconfig.xxx configuration files.

#How to set up Quagga BGP router.

Example of content for */usr/pkg/etc/zebra/bgpd.conf* file:
<pre><code>
!
hostname bgpd.qw
password xxxx
enable password xxxx
log file /var/log/zebra/bgpd.log
!
router bgp 12121
bgp router-id 192.168.170.1
network 192.168.170.0/24
!
!
!
neighbor 192.168.171.1 remote-as 12121
neighbor 192.168.171.1 description GW-TER-UA
neighbor 192.168.171.1 version 4
neighbor 192.168.171.1 soft-reconfiguration inbound
neighbor 192.168.171.1 router-map UA-IN in
neighbor 192.168.171.1 prefix-list UA-OUT out
!
!
!
neighbor 192.168.172.1 remote-as 12121
neighbor 192.168.172.1 description GW-TER-WORLD
neighbor 192.168.172.1 version 4
neighbor 192.168.172.1 soft-reconfiguration inbound
neighbor 192.168.172.1 router-map WOLRD-IN in
neighbor 192.168.172.1 prefix-list WORLD-OUT out
!
!
!
router-map WORLD-IN permit 10
 set local-preference 200
!
ip prefix-list WORLD-OUT permit 192.168.170.0/24
!
!
!
router-map UA-IN permit 10
set local-preference 100
!
ip prefix-list UA-OUT permit 192.168.170.0/24
!
!
!
access-list CONF permit 192.168.170.0/24
access-list CONF deny any
!
!
!
line vty
 access-class CONF
 exec-timeout 120 0
</pre></code>

#Example: osfpd.conf

Here is an example of */usr/pk/etc/zebra/ospfd.conf* file:

<pre><code>
hostname yourhostname
password yourpassword
enable password yourpassword

interface rtk0
 no ip ospf authentication-key
 ip ospf hello-interval 2
 ip ospf dead-interval 5

interface rtk1
 no ip ospf authentication-key
 ip ospf hello-interval 2
 ip ospf dead-interval 5

router ospf
  ospf router-id A.B.C.D
  network 192.168.170.0/24 area 0
  network 192.168.171.0/24 area 0
</pre></code>

#vtysh


To manage quagga router do:

    # vtysh

See also [Quagga Routing Suite](http://www.quagga.net/)

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb