summaryrefslogtreecommitdiffstats
path: root/vnfs/vLB/scripts/v_lb_init.sh
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-08-15 13:44:48 -0400
committerMarco Platania <platania@research.att.com>2017-08-15 13:44:48 -0400
commita445ef826ac13e271f89f3e6b221df2d0be3d623 (patch)
tree9d7c978f5ec9f95de0853914ac0095cf29e96cee /vnfs/vLB/scripts/v_lb_init.sh
parent0f379776bf59d6f0faf5c8e24996eeaf6bbb6239 (diff)
Update vLB to Ubuntu 1604 and VPP 1707
vLB based on Ubuntu 1404 and VPP 1609 doesn't work in some OpenStack labs Change-Id: Ibbd904d0eed1f02b7aca2d173e469c53f235f700 Issue-ID: UCA-34 Signed-off-by: Marco Platania <platania@research.att.com>
Diffstat (limited to 'vnfs/vLB/scripts/v_lb_init.sh')
-rwxr-xr-xvnfs/vLB/scripts/v_lb_init.sh42
1 files changed, 28 insertions, 14 deletions
diff --git a/vnfs/vLB/scripts/v_lb_init.sh b/vnfs/vLB/scripts/v_lb_init.sh
index 8767a943..3c816c8d 100755
--- a/vnfs/vLB/scripts/v_lb_init.sh
+++ b/vnfs/vLB/scripts/v_lb_init.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# Start VPP
-start vpp
+systemctl start vpp
sleep 1
# Compute the network CIDR from the Netmask
@@ -25,30 +25,41 @@ mask2cidr() {
echo "$nbits"
}
-IPADDR1_MASK=$(ifconfig eth0 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
+IPADDR1_MASK=$(ifconfig eth3 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
IPADDR1_CIDR=$(mask2cidr $IPADDR1_MASK)
IPADDR2_MASK=$(ifconfig eth1 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
IPADDR2_CIDR=$(mask2cidr $IPADDR2_MASK)
# Configure VPP for vPacketGenerator
-IPADDR1=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+IPADDR1=$(ifconfig eth3 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
IPADDR2=$(ifconfig eth1 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
-HWADDR1=$(ifconfig eth0 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
+HWADDR1=$(ifconfig eth3 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
HWADDR2=$(ifconfig eth1 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
-FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
-FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
+FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
+FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
GW=$(route -n | grep "^0.0.0.0" | awk '{print $2}')
+PKTGEN_IPADDR=$(cat /opt/config/pktgen_ipaddr.txt)
+VIP=$(cat /opt/config/vip.txt)
-ifconfig eth0 down
-ifconfig eth0 hw ether $FAKE_HWADDR1
-ip addr flush dev eth0
-ifconfig eth0 up
+while [ $(ping -c 1 $PKTGEN_IPADDR | grep received | cut -d" " -f4) != 1 ];
+do
+ echo "Wait";
+ sleep 1;
+done
+
+sleep 3
+PKTGEN_MAC=$(arp -n | grep -w $PKTGEN_IPADDR | tr -s ' ' | cut -d' ' -f3)
+
+ifconfig eth3 down
+ifconfig eth3 hw ether $FAKE_HWADDR1
+ip addr flush dev eth3
+ifconfig eth3 up
vppctl tap connect tappub hwaddr $HWADDR1
-vppctl set int ip address tap-0 $IPADDR1"/"$IPADDR1_CIDR
+vppctl set int ip address tap-0 $VIP"/"$IPADDR1_CIDR
vppctl set int state tap-0 up
brctl addbr br0
brctl addif br0 tappub
-brctl addif br0 eth0
+brctl addif br0 eth3
ifconfig br0 up
ifconfig eth1 down
@@ -66,13 +77,16 @@ sleep 1
vppctl lb conf ip4-src-address $IPADDR2
vppctl lb vip $IPADDR1"/32" encap gre4
-vppctl ip route add 0.0.0.0/0 via $GW
sleep 1
+vppctl set ip arp proxy $IPADDR1" - "$IPADDR1
+vppctl set interface proxy-arp tap-0 enable
+vppctl set ip arp tap-0 $PKTGEN_IPADDR $PKTGEN_MAC
+
cd /opt/FDserver
./dnsmembership.sh &>/dev/null &disown
# Start VES client
cd /opt/VES/code/evel_training/VESreporting/
echo 0 > active_dns.txt
-./go-client.sh &>/dev/null &disown
+./go-client.sh &>/dev/null &disown \ No newline at end of file