$ sudo apt-get install quagga
Activate the BGP and Zebra daemons:
- Add the following line to /etc/quagga/daemons:
- zebra= yes
- bgpd = yes
- Touch an empty bgpdconfiguration file:
$ sudo touch /etc/quagga/bgpd.conf
- A slightly more useful configuration file would contain the following lines:
hostname R7 (R7 is the hostname. You can label it as you want.)
password ***** (Choose your password)
enable password ***** (Repeat your password)
log timestamp precision 6
log file /var/log/quagga/bgpd.log
!
line vty
exec-timeout 0 0
!
- The most important information is the specific location of the log file, where the BGP process can log debugging and other useful information. A common convention is to store the log files under /var/log/quagga.
- You must restart quaggawhen a new daemon is enabled:
$ sudo service quagga restart
We are going to set up a route reflector client. It allows all IBGP speakers within your autonomous network to learn about the available routes without introducing loops. That being said, our Quagga router configuration should look like this:
$ sudo vtysh
Hello, this is Quagga (version 0.99.21). Copyright 1996-2005 Kunihiro Ishiguro, et al. R7# write terminal
hostname R7 log file /var/log/quagga/bgpd.log log timestamp precision 6 hostname Quagga_A ! router bgp 65504 bgp router-id 10.0.1.100 network 192.168.2.0/24 neighbor 10.0.1.10 remote-as 65504 neighbor 10.0.1.10 route-reflector-client ! line vty exec-timeout 0 0 !
As you see:
- BGP is in AS 65504
- Router-ID/RIB-ID is 10.0.1.14 (Virtual machine where Quagga instance is running)
- Quagga is running IPv4 unicast and announcing network 192.168.2.0/24 (choose your preferred IP address)
- Quagga is running iBGP
- OpenDaylight has the IP address 10.0.1.10
- OpenDaylight is also in AS 65504 so this is iBGP
- Quagga is reflecting IPv4 unicast prefixes to ODL
The OpenDaylight controller IP is running on 10.0.1.10 and the topology is being simulated with Mininet in a separate VM, running on 10.0.1.14, where a Quagga instance is also running.
In order to set up a Quagga router accordingly, we have to follow these steps:
$ sudo vtysh
Hello, this is Quagga (version 0.99.21). Copyright 1996-2005 Kunihiro Ishiguro, et al.
R7# configure terminal
R7(config)# router bgp 65504 (Identify the BGP node by assigning an ASN) R7(config-router)# bgp router-id 10.0.1.100 (Identify the BGP node by assigning a router-id:) R7(config-router)# neighbor 10.0.1.10 remote-as 65504 (Specify to whom it must disseminate routing information) R7(config-router)# address-family ipv4 unicast (Specifying the peer’s IP address allows BGP to set up a TCP socket with this peer) R7(config-router-af)# neighbor 10.0.1.10 activate (Distribute prefixes to the peer) R7(config-router-af)# exit R7(config-router)# neighbor 10.0.1.10 route-reflector-client (Setup route reflector client) R7(config-router)# address-family ipv4 unicast (Specify what prefixes to originate) R7(config-router)# network 192.0.2.0/24 (Specify what prefixes to originate)
OpenDaylight karaf edition comes pre-configured with baseline BGP configuration. You can find it in the etc/opendaylight/karaf directory and it consists of two files:
- 31-bgp.xml, which defines the basic parser and RIB support
- 41-bgp-example.xml, which contains a sample configuration which needs to be customized to your deployment.
Go to the 41-bgp-example.xml file and make the following changes:
<host>10.0.1.14</host> # Machine/VM where Quagga is running
<peer-role>ibgp</peer-role> ... <local-as>65504</local-as> #Same as defined in the router config
<bgp-rib-id>10.0.1.10</bgp-rib-id># OpenDaylight controller IP
We also need to have some installed features:
feature:install odl-bgpcep-bgp-all odl-bgpcep-pcep-all odl-restconf-noauth odl-netconf-all odl-dlux-all odl-openflowplugin-all
Before you start capturing logs, edit file etc/org.ops4j.pax.logging.cfg
- line: log4j.appender.out.maxFileSize=1000000MB (This prevents log files from rotating)
- add the following lines at the end of the file:
log4j.logger.org.opendaylight.bgpcep = TRACE
log4j.logger.org.opendaylight.protocol = TRACE
Log file will be located in /data/log/karaf.log, after you run ODL.
After you set up the router, we should start our OpenDaylight instance with the aforementioned features installed. When everything is setup, you should see the following messages in your Karaf’s log:
2016-04-04 16:38:48,113 | TRACE | oupCloseable-2-1 | BGPByteToMessageDecoder | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Received to decode: ffffffffffffffffffffffffffffffff001304 2016-04-04 16:38:48,113 | DEBUG | oupCloseable-2-1 | BGPSessionImpl | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Message was received: Keepalive [augmentation=[]] 2016-04-04 16:38:48,114 | TRACE | oupCloseable-2-1 | BGPSessionImpl | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Received KeepAlive messsage. 2016-04-04 16:38:48,141 | TRACE | oupCloseable-2-1 | BGPMessageToByteEncoder | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Encoding message: Keepalive [augmentation=[]] 2016-04-04 16:38:48,141 | TRACE | oupCloseable-2-1 | BGPMessageToByteEncoder | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Encoded message: ffffffffffffffffffffffffffffffff001304 2016-04-04 16:38:48,141 | DEBUG | oupCloseable-2-1 | BGPMessageToByteEncoder | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Message sent to output: Keepalive [augmentation=[]] 2016-04-04 16:38:48,141 | TRACE | oupCloseable-2-1 | BGPSessionImpl | 184 - org.opendaylight.bgpcep.bgp-rib-impl - 0.5.0.Beryllium | Message Keepalive [augmentation=[]] sent to socket [id: 0x7814ccbc, /10.0.1.10:59988 => /10.0.1.14:179]
References: