From e6b4787233b549b730e1bc4a8b099b7cf131adb1 Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Thu, 26 Oct 2017 17:55:07 -0700 Subject: 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 --- vnfs/vCPE/scripts/v_gmux_install.sh | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'vnfs') 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" -- cgit 1.2.3-korg