7 # Compute the network CIDR from the Netmask
22 *) echo "Error: $dec is not recognized"; exit 1
28 IPADDR1_MASK=$(ifconfig eth3 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
29 IPADDR1_CIDR=$(mask2cidr $IPADDR1_MASK)
30 IPADDR2_MASK=$(ifconfig eth1 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
31 IPADDR2_CIDR=$(mask2cidr $IPADDR2_MASK)
33 # Configure VPP for vPacketGenerator
34 IPADDR1=$(ifconfig eth3 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
35 IPADDR2=$(ifconfig eth1 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
36 HWADDR1=$(ifconfig eth3 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
37 HWADDR2=$(ifconfig eth1 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
38 FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
39 FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
40 GW=$(route -n | grep "^0.0.0.0" | awk '{print $2}')
41 PKTGEN_IPADDR=$(cat /opt/config/pktgen_ipaddr.txt)
42 VIP=$(cat /opt/config/vip.txt)
44 while [ $(ping -c 1 $PKTGEN_IPADDR | grep received | cut -d" " -f4) != 1 ];
51 PKTGEN_MAC=$(arp -n | grep -w $PKTGEN_IPADDR | tr -s ' ' | cut -d' ' -f3)
54 ifconfig eth3 hw ether $FAKE_HWADDR1
55 ip addr flush dev eth3
57 vppctl tap connect tappub hwaddr $HWADDR1
58 vppctl set int ip address tap-0 $VIP"/"$IPADDR1_CIDR
59 vppctl set int state tap-0 up
61 brctl addif br0 tappub
66 ifconfig eth1 hw ether $FAKE_HWADDR2
67 ip addr flush dev eth1
69 vppctl tap connect tap111 hwaddr $HWADDR2
70 vppctl set int ip address tap-1 $IPADDR2"/"$IPADDR2_CIDR
71 vppctl set int state tap-1 up
73 brctl addif br1 tap111
78 vppctl lb conf ip4-src-address $IPADDR2
79 vppctl lb vip $IPADDR1"/32" encap gre4
82 vppctl set ip arp proxy $IPADDR1" - "$IPADDR1
83 vppctl set interface proxy-arp tap-0 enable
84 vppctl set ip arp tap-0 $PKTGEN_IPADDR $PKTGEN_MAC
87 ./dnsmembership.sh &>/dev/null &disown
90 cd /opt/VES/code/evel_training/VESreporting/
91 echo 0 > active_dns.txt
92 ./go-client.sh &>/dev/null &disown