summaryrefslogtreecommitdiffstats
path: root/sdnvpn/artifacts/quagga_setup.sh
diff options
context:
space:
mode:
authorRomanos Skiadas <rski@intracom-telecom.com>2016-09-08 16:23:40 +0300
committerRomanos Skiadas <rski@intracom-telecom.com>2017-03-02 15:54:33 +0200
commitbe5cd25ed85bb42f4115b49aec13ddfec20c1b97 (patch)
tree656520216279d026ad7c1bd3c8eb013deb810648 /sdnvpn/artifacts/quagga_setup.sh
parent71273a2b8d51725be2743010fb65fb46229dd10c (diff)
Implement quagga peering
- Create an openstack instance - Assign it a floating IP - Execute a quagga bootstrap script using cloud init - Tell ODL to peer with the instance - Start an instance in a VPN - make sure the route was exchanged between the peered quagga and ODL Change-Id: I73bcaec5425df2b953c2bceaca7d4f09ff28f3d0 Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
Diffstat (limited to 'sdnvpn/artifacts/quagga_setup.sh')
-rw-r--r--sdnvpn/artifacts/quagga_setup.sh68
1 files changed, 68 insertions, 0 deletions
diff --git a/sdnvpn/artifacts/quagga_setup.sh b/sdnvpn/artifacts/quagga_setup.sh
new file mode 100644
index 0000000..6da50e1
--- /dev/null
+++ b/sdnvpn/artifacts/quagga_setup.sh
@@ -0,0 +1,68 @@
+#! /bin/bash
+
+set -xe
+
+# change the password because this script is run on a passwordless cloud-image
+echo 'ubuntu:opnfv' | chpasswd
+
+# Wait for a floating IP
+# as a workaround to NAT breakage
+sleep 20
+
+# Variables to be filled in with python
+NEIGHBOR_IP=%s
+OWN_IP=%s
+
+ZEBRA_CONFIG_LOCATION="/etc/quagga/zebra.conf"
+DAEMONS_FILE_LOCATION="/etc/quagga/daemons"
+BGPD_CONFIG_LOCATION="/etc/quagga/daemons"
+BGPD_LOG_FILE="/var/log/bgpd.log"
+
+DEBIAN_FONTEND=noninteractive apt-get update
+DEBIAN_FRONTEND=noninteractive apt-get install quagga -y
+
+touch $BGPD_LOG_FILE
+chown quagga:quagga $BGPD_LOG_FILE
+
+chown quagga:quagga $DAEMONS_FILE_LOCATION
+cat <<CATEOF > $DAEMONS_FILE_LOCATION
+zebra=yes
+bgpd=yes
+ospfd=no
+ospf6d=no
+ripd=no
+ripngd=no
+isisd=no
+babeld=no
+CATEOF
+
+touch $ZEBRA_CONFIG_LOCATION
+chown quagga:quagga $ZEBRA_CONFIG_LOCATION
+
+cat <<CATEOF > $BGPD_CONFIG_LOCATION
+! -*- bgp -*-
+
+hostname bgpd
+password sdncbgpc
+
+router bgp 200
+ bgp router-id ${OWN_IP}
+ neighbor ${NEIGHBOR_IP} remote-as 100
+ no neighbor ${NEIGHBOR_IP} activate
+!
+ address-family vpnv4 unicast
+ neighbor ${NEIGHBOR_IP} activate
+ exit-address-family
+!
+line vty
+ exec-timeout 0 0
+!
+debug bgp events
+debug bgp updates
+log file ${BGPD_LOG_FILE}
+end
+CATEOF
+chown quagga:quagga $BGPD_CONFIG_LOCATION
+
+pgrep bgpd
+pgrep zebra