5 # change the password because this script is run on a passwordless cloud-image
6 echo 'ubuntu:opnfv' | chpasswd
10 echo "8.8.8.8" > /etc/resolvconf/resolv.conf.d/head
13 # Wait for a floating IP
14 # as a workaround to NAT breakage
17 # Variables to be filled in with python
20 # directly access the instance from the external net without NAT
24 ip addr add $OWN_IP/$EXT_NET_MASK dev ens7
26 ZEBRA_CONFIG_LOCATION="/etc/quagga/zebra.conf"
27 DAEMONS_FILE_LOCATION="/etc/quagga/daemons"
28 BGPD_CONFIG_LOCATION="/etc/quagga/bgpd.conf"
29 BGPD_LOG_FILE="/var/log/bgpd.log"
31 DEBIAN_FRONTEND=noninteractive apt-get update
32 DEBIAN_FRONTEND=noninteractive apt-get install quagga -y
35 chown quagga:quagga $BGPD_LOG_FILE
37 chown quagga:quagga $DAEMONS_FILE_LOCATION
38 cat <<CATEOF > $DAEMONS_FILE_LOCATION
49 touch $ZEBRA_CONFIG_LOCATION
50 chown quagga:quagga $ZEBRA_CONFIG_LOCATION
52 cat <<CATEOF > $BGPD_CONFIG_LOCATION
59 bgp router-id ${OWN_IP}
60 neighbor ${NEIGHBOR_IP} remote-as 100
61 no neighbor ${NEIGHBOR_IP} activate
63 address-family vpnv4 unicast
64 neighbor ${NEIGHBOR_IP} activate
72 log file ${BGPD_LOG_FILE}
75 chown quagga:quagga $BGPD_CONFIG_LOCATION
76 service quagga restart