vCPE vG-MUX - fixup default vpp configuration 39/20839/1
authorEric Multanen <eric.w.multanen@intel.com>
Fri, 27 Oct 2017 00:55:07 +0000 (17:55 -0700)
committerEric Multanen <eric.w.multanen@intel.com>
Fri, 27 Oct 2017 01:01:05 +0000 (18:01 -0700)
Instead of hard coding VPP interface names, derive them from
the PCI addresses of the network devices when setting up the
default vpp configuration in /etc/vpp/setup.gate.

Also, remove the vxlan tunnel configuration from the default
vpp configuration - this will be created by SDNC.

Change-Id: Ife48ac19b8d3869c7d65e83bdf8ab9a5a2c3301c
Issue-ID: INT-63
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
vnfs/vCPE/scripts/v_gmux_install.sh

index 23372c4..1907a5f 100644 (file)
@@ -217,14 +217,27 @@ cpu {
 
 EOF
 
-    cat > /etc/vpp/setup.gate << EOF
-set int state GigabitEthernet0/4/0 up
-set int ip address GigabitEthernet0/4/0 ${BNG_MUX_IP}/${BNG_MUX_CIDR#*/}
+    # Get list of network device PCI bus addresses
+    get_nic_pci_list() {
+        while read -r line ; do
+            if [ "$line" != "${line#*network device}" ]; then
+                echo -n "${line%% *} "
+            fi
+        done < <(lspci)
+    }
+
+    NICS=$(get_nic_pci_list)
+    NICS=`echo ${NICS} | sed 's/[0]\+\([0-9]\)/\1/g' | sed 's/[.:]/\//g'`
 
-set int state GigabitEthernet0/6/0 up
-set int ip address GigabitEthernet0/6/0 ${MUX_GW_IP}/${MUX_GW_CIDR#*/}
+    BNG_MUX_NIC=GigabitEthernet`echo ${NICS} | cut -d " " -f 2`  # second interface in list
+    MUX_GW_NIC=GigabitEthernet`echo ${NICS} | cut -d " " -f 4`   # fourth interface in list
+
+    cat > /etc/vpp/setup.gate << EOF
+set int state ${BNG_MUX_NIC} up
+set int ip address ${BNG_MUX_NIC} ${BNG_MUX_IP}/${BNG_MUX_CIDR#*/}
 
-create vxlan tunnel src ${MUX_GW_IP} dst 10.5.0.21 vni 100
+set int state ${MUX_GW_NIC} up
+set int ip address ${MUX_GW_NIC} ${MUX_GW_IP}/${MUX_GW_CIDR#*/}
 EOF
 
 fi  # endif BUILD_STATE != "build"