aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vCPE/scripts
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-11-14 20:19:09 +0000
committerGerrit Code Review <gerrit@onap.org>2017-11-14 20:19:09 +0000
commit780f4fee89b23e98e090afa17d2bebd76f1b34d6 (patch)
treefb0be046a9c56b61943738cad2359ee3f831a4b2 /vnfs/vCPE/scripts
parent75bcf067e4f8a1bc7fad3fa3265d09d96fea386a (diff)
parente190d0dbb1bce4faad8dcbcbe01d116dd00f702c (diff)
Merge "Configure honeycomb NAT settings after vpp crash"
Diffstat (limited to 'vnfs/vCPE/scripts')
-rw-r--r--vnfs/vCPE/scripts/v_brgemu_init.sh4
-rwxr-xr-xvnfs/vCPE/scripts/v_brgemu_install.sh30
2 files changed, 30 insertions, 4 deletions
diff --git a/vnfs/vCPE/scripts/v_brgemu_init.sh b/vnfs/vCPE/scripts/v_brgemu_init.sh
index fdeb4395..e9697992 100644
--- a/vnfs/vCPE/scripts/v_brgemu_init.sh
+++ b/vnfs/vCPE/scripts/v_brgemu_init.sh
@@ -2,6 +2,4 @@
systemctl start vpp
systemctl start honeycomb
-
-/opt/bind_nic.sh
-/opt/set_nat.sh
+systemctl start nat
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