From: Eric Multanen Date: Fri, 27 Oct 2017 00:55:07 +0000 (-0700) Subject: vCPE vG-MUX - fixup default vpp configuration X-Git-Tag: 1.0.0-Amsterdam~85 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=e6b4787233b549b730e1bc4a8b099b7cf131adb1;hp=d4d0d9fa55382eadfe759baccfaf6408f6338d28;p=demo.git vCPE vG-MUX - fixup default vpp configuration 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 --- diff --git a/vnfs/vCPE/scripts/v_gmux_install.sh b/vnfs/vCPE/scripts/v_gmux_install.sh index 23372c49..1907a5f1 100644 --- a/vnfs/vCPE/scripts/v_gmux_install.sh +++ b/vnfs/vCPE/scripts/v_gmux_install.sh @@ -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"