diff options
Diffstat (limited to 'vnfs/vCPE/scripts')
-rw-r--r-- | vnfs/vCPE/scripts/v_brgemu_init.sh | 1 | ||||
-rw-r--r-- | vnfs/vCPE/scripts/v_brgemu_install.sh | 57 | ||||
-rw-r--r-- | vnfs/vCPE/scripts/v_gmux_install.sh | 19 |
3 files changed, 66 insertions, 11 deletions
diff --git a/vnfs/vCPE/scripts/v_brgemu_init.sh b/vnfs/vCPE/scripts/v_brgemu_init.sh index 1bf8a500..fdeb4395 100644 --- a/vnfs/vCPE/scripts/v_brgemu_init.sh +++ b/vnfs/vCPE/scripts/v_brgemu_init.sh @@ -3,4 +3,5 @@ systemctl start vpp systemctl start honeycomb +/opt/bind_nic.sh /opt/set_nat.sh diff --git a/vnfs/vCPE/scripts/v_brgemu_install.sh b/vnfs/vCPE/scripts/v_brgemu_install.sh index c4626a41..86d08b4b 100644 --- a/vnfs/vCPE/scripts/v_brgemu_install.sh +++ b/vnfs/vCPE/scripts/v_brgemu_install.sh @@ -193,9 +193,61 @@ set bridge-domain arp term 10 EOF cat >> /opt/config/ip.txt << EOF -hcip: 192.168.1.20 +hcip: 192.168.4.20 EOF +cat > /opt/bind_nic.sh << EOF +while : +do + if [[ ! $(ps -aux | grep [[:alnum:]]*/vpp/startup.conf | wc -l) = 2 ]]; then + #echo "vpp not running" + else + break + fi +done +nic_name=$(lshw -C network | grep "logical name:") +nic_name=${nic_name#*:} +ifconfig $nic_name down +service vpp restart +while read -r line +do + re=${line#*/[0-9]/[0-9]} + if [ "$line" != "$re" ]; then + nic=${line%(*} + vppctl set dhcp client intfc $nic + vppctl set int state $nic up + break + fi +done < <(vppctl show int addr) +while read -r sdnc_ip +do + if [[ $sdnc_ip = sdnc_ip* ]]; then + sdnc_ip=${sdnc_ip#*" "} + break + fi +done < /opt/config/ip.txt + +vppctl tap connect tap0 +vppctl set int state tap-0 up +vppctl set int ip addr tap-0 20.0.0.40/24 +ifconfig tap0 192.168.4.20/24 +route add -host $sdnc_ip tap0 +route add -host 20.0.0.40 tap0 +vppctl ip route add 192.168.4.0/24 via tap-0 +vppctl set interface snat in tap-0 out $nic +while read -r hw +do + if [[ "$hw" = tap-0* ]]; then + read -r hw + hw_addr=${hw#" "} + hw_addr=${hw_addr#" "} + break + fi +done < <(vppctl show hardware) +arp -s $sdnc_ip $hw_addr +EOF +chmod +x /opt/bind_nic.sh + #set nat rule cat > /opt/set_nat.sh << EOF #! /bin/bash @@ -206,6 +258,7 @@ do #echo "vpp not running" continue fi + flag=0 while read -r line do @@ -245,6 +298,8 @@ do sleep 1 done EOF +chmod +x /opt/set_nat.sh + # Download and install HC2VPP from source cd /opt git clone ${HC2VPP_SOURCE_REPO_URL} -b ${HC2VPP_SOURCE_REPO_BRANCH} hc2vpp diff --git a/vnfs/vCPE/scripts/v_gmux_install.sh b/vnfs/vCPE/scripts/v_gmux_install.sh index e7d39377..9ab81403 100644 --- a/vnfs/vCPE/scripts/v_gmux_install.sh +++ b/vnfs/vCPE/scripts/v_gmux_install.sh @@ -71,7 +71,7 @@ apt-get install --allow-unauthenticated -y wget openjdk-8-jdk apt-transport-http sleep 1 # Install the tools required for download codes -apt-get install -y expect git patch +apt-get install -y expect git patch make #Download and build the VPP codes cd /opt @@ -81,28 +81,27 @@ wget -O Vpp-Add-VES-agent-for-vG-MUX.patch ${VPP_PATCH_URL} cd vpp patch -p1 < ../Vpp-Add-VES-agent-for-vG-MUX.patch expect -c " - set timeout 60; spawn make install-dep; expect { \"Do you want to continue?*\" {send \"Y\r\"; interact} } " -cd build-root -./bootstrap.sh -make V=0 PLATFORM=vpp TAG=vpp install-deb - # Install the evel-library first since we need the lib cd /opt apt-get install -y libcurl4-openssl-dev -git clone https://github.com/att/evel-library.git -cd evel-library/bldjobs +git clone http://gerrit.onap.org/r/demo +cd demo/vnfs/VES5.0/evel/evel-library/bldjobs make -cp /opt/evel-library/libs/libevel.so /usr/lib +cp ../libs/x86_64/libevel.so /usr/lib ldconfig -# Install the VPP package cd /opt/vpp/build-root +./bootstrap.sh +make V=0 PLATFORM=vpp TAG=vpp install-deb + +# Install the VPP package +apt install -y python-ply-lex-3.5 python-ply-yacc-3.5 python-pycparser python-cffi dpkg -i *.deb systemctl stop vpp |