aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrivahni <srivahni.chivukula@intel.com>2017-11-17 16:18:54 -0800
committerSrivahni <srivahni.chivukula@intel.com>2017-11-17 16:19:16 -0800
commitcb134dbc9d224cca3ee54dd6dbd9a7ecd3bfdd4d (patch)
tree450fbcd45aa2c7fd3fd4a8a519c47fdb1b1bce2b
parentc22ae94f7fcb6b2f49b23e2fefe2ef501106aad5 (diff)
Fixed tap, lstack and DHCP problems
Moved tap and lstack configuration from setup.gate file to vGW init script Created vGW service to start after honeycomb service and modified DHCP service to start after vGW service Change-Id: Ib6936f6a1108ccdc34b3257a7bb82b49661f1e3b Issue-ID: INT-63 Signed-off-by: Srivahni <srivahni.chivukula@intel.com>
-rw-r--r--vnfs/vCPE/scripts/v_gw_install.sh52
1 files changed, 39 insertions, 13 deletions
diff --git a/vnfs/vCPE/scripts/v_gw_install.sh b/vnfs/vCPE/scripts/v_gw_install.sh
index b86e62fd..53ac6903 100644
--- a/vnfs/vCPE/scripts/v_gw_install.sh
+++ b/vnfs/vCPE/scripts/v_gw_install.sh
@@ -216,12 +216,8 @@ set int ip address ${MUX_GW_NIC} ${MUX_GW_IP}/${MUX_GW_CIDR#*/}
set int state ${GW_PUB_NIC} up
set dhcp client intfc ${GW_PUB_NIC} hostname vg-1
-tap connect lstack address 192.168.1.1/24
-set int state tap-0 up
-
create vxlan tunnel src ${MUX_GW_IP} dst ${MUX_IP_ADDR} vni ${VG_VGMUX_TUNNEL_VNI}
set interface l2 bridge vxlan_tunnel0 10 1
-set interface l2 bridge tap-0 10 0
set bridge-domain arp term 10
loopback create
@@ -402,15 +398,46 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
}
EOF
- # Download DHCP config files
- cd /opt
- wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_gw_init.sh
- wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_gw.sh
+echo '#!/bin/bash
+STATUS=$(ip link show lstack)
+if [ -z "$STATUS" ]
+then
+ vppctl tap connect lstack address 192.168.1.1/24
+ vppctl set int state tap-0 up
+ vppctl set interface l2 bridge tap-0 10 0
+fi
+IP=$(/sbin/ifconfig lstack | grep "inet addr:" | cut -d: -f2 | awk "{ print $1 }")
+if [ ! -z "$STATUS" ] && [ -z "$IP" ]
+then
+ ip link delete lstack
+ vppctl tap delete tap-0
+ vppctl tap connect lstack address 192.168.1.1/24
+ vppctl set int state tap-0 up
+ vppctl set interface l2 bridge tap-0 10 0
+fi' > /opt/v_gw_init.sh
+
chmod +x v_gw_init.sh
- chmod +x v_gw.sh
- mv v_gw.sh /etc/init.d
- sed -i '/# Provides:/ s/$/ v_gw/' /etc/init.d/v_gw.sh
- update-rc.d v_gw.sh defaults
+
+ cat > /etc/systemd/system/vgw.service << EOF
+[Unit]
+Description=vGW service to run after honeycomb service
+Requires=honeycomb.service
+After=honeycomb.service
+
+[Service]
+ExecStart=/opt/v_gw_init.sh
+Restart=always
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+ systemctl enable /etc/systemd/system/vgw.service
+
+ cp /etc/systemd/system/multi-user.target.wants/isc-dhcp-server.service /etc/systemd/system/
+ sed -i '/Documentation/a Wants=vgw.service\nAfter=vgw.service' /etc/systemd/system/isc-dhcp-server.service
+ sed -i '/exec dhcpd/a Restart=always\nRestartSec=10' /etc/systemd/system/isc-dhcp-server.service
# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
if [[ $CLOUD_ENV != "rackspace" ]]
@@ -423,5 +450,4 @@ EOF
reboot
fi
- ./v_gw_init.sh
fi # endif BUILD_STATE != "build"