7 # Configure VPP for vPacketGenerator
8 IPADDR1=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
9 IPADDR2=$(ifconfig eth1 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
10 HWADDR1=$(ifconfig eth0 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
11 HWADDR2=$(ifconfig eth1 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
12 FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
13 FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
14 GW=$(route | grep default | awk '{print $2}')
17 ifconfig eth0 hw ether $FAKE_HWADDR1
18 ip addr flush dev eth0
20 vppctl tap connect tappub hwaddr $HWADDR1
21 vppctl set int ip address tap-0 $IPADDR1"/24"
22 vppctl set int state tap-0 up
24 brctl addif br0 tappub
29 ifconfig eth1 hw ether $FAKE_HWADDR2
30 ip addr flush dev eth1
32 vppctl tap connect tap111 hwaddr $HWADDR2
33 vppctl set int ip address tap-1 $IPADDR2"/24"
34 vppctl set int state tap-1 up
36 brctl addif br1 tap111
41 vppctl lb conf ip4-src-address $IPADDR2
42 vppctl lb vip $IPADDR1"/32" encap gre4
43 vppctl ip route add 0.0.0.0/0 via $GW
47 ./dnsmembership.sh &>/dev/null &disown
50 cd /opt/VES/code/evel_training/VESreporting/
51 echo 0 > active_dns.txt
52 ./go-client.sh &>/dev/null &disown