7 # Compute the network CIDR from the Netmask
22 *) echo "Error: $dec is not recognized"; exit 1
28 IPADDR1_MASK=$(ifconfig eth0 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
29 IPADDR1_CIDR=$(mask2cidr $IPADDR1_MASK)
31 # Configure VPP for vPacketGenerator
32 IPADDR1=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
33 IPADDR2=$(ifconfig eth1 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
34 HWADDR1=$(ifconfig eth0 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
35 HWADDR2=$(ifconfig eth1 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
36 FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
37 FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null |hexdump -v -e '/1 ":%02X"')
38 GW=$(route -n | grep "^0.0.0.0" | awk '{print $2}')
41 ifconfig eth0 hw ether $FAKE_HWADDR1
42 ip addr flush dev eth0
44 vppctl tap connect tappub hwaddr $HWADDR1
45 vppctl set int ip address tap-0 $IPADDR1"/"$IPADDR1_CIDR
46 vppctl set int state tap-0 up
48 brctl addif br0 tappub
53 ifconfig eth1 hw ether $FAKE_HWADDR2
54 ip addr flush dev eth1
56 vppctl tap connect tap111 hwaddr $HWADDR2
57 vppctl set int ip address tap-1 $IPADDR2"/24"
58 vppctl set int state tap-1 up
60 brctl addif br1 tap111
65 vppctl lb conf ip4-src-address $IPADDR2
66 vppctl lb vip $IPADDR1"/32" encap gre4
67 vppctl ip route add 0.0.0.0/0 via $GW
71 ./dnsmembership.sh &>/dev/null &disown
74 cd /opt/VES/code/evel_training/VESreporting/
75 echo 0 > active_dns.txt
76 ./go-client.sh &>/dev/null &disown