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"/24"
47 vppctl set int state tap-0 up
49 brctl addif br0 tappub
54 ifconfig eth1 hw ether $FAKE_HWADDR2
55 ip addr flush dev eth1
57 vppctl tap connect tap111 hwaddr $HWADDR2
58 vppctl set int ip address tap-1 $IPADDR2"/24"
59 vppctl set int state tap-1 up
61 brctl addif br1 tap111
66 vppctl lb conf ip4-src-address $IPADDR2
67 vppctl lb vip $IPADDR1"/32" encap gre4
68 vppctl ip route add 0.0.0.0/0 via $GW
72 ./dnsmembership.sh &>/dev/null &disown
75 cd /opt/VES/code/evel_training/VESreporting/
76 echo 0 > active_dns.txt
77 ./go-client.sh &>/dev/null &disown