summaryrefslogtreecommitdiffstats
path: root/vnfs/vCPE/scripts/v_brgemu_install.sh
diff options
context:
space:
mode:
authorItohan <itohan.ukponmwan@intel.com>2017-11-14 18:40:44 -0800
committerItohan <itohan.ukponmwan@intel.com>2017-11-14 18:51:35 -0800
commite190d0dbb1bce4faad8dcbcbe01d116dd00f702c (patch)
tree9137af46961212c5e442cee7b7c745ba2eae4ee0 /vnfs/vCPE/scripts/v_brgemu_install.sh
parente834f4dc739f494f6e4c726bb0e387c5b092b462 (diff)
Configure honeycomb NAT settings after vpp crash
Modified vbrg install script to include a service to reconfigure vpp honeycomb NAT after vpp crash Modified vbrg init script to start nat service Change-Id: I417caa5759d83b429ca4b44f42737c0f9061a3d8 Issue-ID: INT-63 Signed-off-by: Itohan <itohan.ukponmwan@intel.com>
Diffstat (limited to 'vnfs/vCPE/scripts/v_brgemu_install.sh')
-rwxr-xr-xvnfs/vCPE/scripts/v_brgemu_install.sh30
1 files changed, 29 insertions, 1 deletions
diff --git a/vnfs/vCPE/scripts/v_brgemu_install.sh b/vnfs/vCPE/scripts/v_brgemu_install.sh
index 0f2b06f5..f8824f97 100755
--- a/vnfs/vCPE/scripts/v_brgemu_install.sh
+++ b/vnfs/vCPE/scripts/v_brgemu_install.sh
@@ -197,7 +197,6 @@ EOF
NICS=$(get_nic_pci_list)
NICS=`echo ${NICS} | sed 's/[0]\+\([0-9]\)/\1/g' | sed 's/[.:]/\//g'`
- echo $NICS
BRG_BNG_NIC=GigabitEthernet`echo ${NICS} | cut -d " " -f 2` # second interface in list
echo $BRG_BNG_NIC > /opt/config/brg_nic.txt
@@ -330,6 +329,17 @@ EOF
chmod +x /opt/set_nat.sh
fi # endif BUILD_STATE != "build"
+#Create script to run bind_nic.sh and set_nat.sh
+ cat > /opt/nat_service.sh << 'EOF'
+#! /bin/bash
+
+sleep 15
+/opt/bind_nic.sh
+/opt/set_nat.sh
+
+EOF
+ chmod +x /opt/nat_service.sh
+
if [[ $BUILD_STATE != "done" ]]
then
@@ -484,6 +494,24 @@ WantedBy=multi-user.target
EOF
systemctl enable /etc/systemd/system/honeycomb.service
+
+ # Create systemctl service for nat script
+ cat > /etc/systemd/system/nat.service << EOF
+[Unit]
+Description=Runs vbrg scripts for nat configuration
+Requires=vpp.service
+After=vpp.service
+
+[Service]
+RemainAfterExit=True
+ExecStart=/opt/nat_service.sh
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ systemctl enable /etc/systemd/system/nat.service
+
# Download DHCP config files
cd /opt
wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_brgemu_init.sh