summaryrefslogtreecommitdiffstats
path: root/vnfs/vLB/scripts/v_packetgen_install.sh
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-08-15 16:58:44 -0400
committerMarco Platania <platania@research.att.com>2017-08-15 16:58:44 -0400
commit5008a779ccb979e1b7aa9ffa6238272f3471702b (patch)
tree5ad98a065846345ca2bd2d49fbdd6b02cfff774b /vnfs/vLB/scripts/v_packetgen_install.sh
parent6eb5e72e6cf45445615586a09815fb00ed02c294 (diff)
Fix ARP issues in vLB and vPKTGEN
- Retrieve vLB and vPKTGEN's MAC address in Heat template - Assign those MAC addresses to VPP tap interfaces Change-Id: Ib4e5d4981031328ca8dc54bd7e5b0031c7f41846 Issue-ID: UCA-34 Signed-off-by: Marco Platania <platania@research.att.com>
Diffstat (limited to 'vnfs/vLB/scripts/v_packetgen_install.sh')
-rw-r--r--vnfs/vLB/scripts/v_packetgen_install.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/vnfs/vLB/scripts/v_packetgen_install.sh b/vnfs/vLB/scripts/v_packetgen_install.sh
index 50d4fce8..0f8014f7 100644
--- a/vnfs/vLB/scripts/v_packetgen_install.sh
+++ b/vnfs/vLB/scripts/v_packetgen_install.sh
@@ -6,6 +6,14 @@ DEMO_ARTIFACTS_VERSION=$(cat /opt/config/demo_artifacts_version.txt)
INSTALL_SCRIPT_VERSION=$(cat /opt/config/install_script_version.txt)
CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
+# Convert Network CIDR to Netmask
+cdr2mask () {
+ # Number of args to shift, 255..255, first non-255 byte, zeroes
+ set -- $(( 5 - ($1 / 8) )) 255 255 255 255 $(( (255 << (8 - ($1 % 8))) & 255 )) 0 0 0
+ [ $1 -gt 1 ] && shift $1 || shift
+ echo ${1-0}.${2-0}.${3-0}.${4-0}
+}
+
# OpenStack network configuration
if [[ $CLOUD_ENV == "openstack" ]]
then