4 # Convert Network CIDR to Netmask
19 *) echo "Error: $dec is not recognized"; exit 1
26 if ! which start; then
27 echo "#!/bin/bash" > /usr/local/sbin/start
28 echo "systemctl start \$1" >> /usr/local/sbin/start
29 chmod u+x /usr/local/sbin/start
34 # Configure VPP for vFirewall
35 IPADDR1=$(ifconfig enp2s0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
36 IPADDR2=$(ifconfig enp3s0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
37 HWADDR1=$(ifconfig enp2s0 | grep -Po "HWaddr \K(.*)")
38 HWADDR2=$(ifconfig enp3s0 | grep -Po "HWaddr \K(.*)")
39 FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
40 FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
42 IPADDR1_MASK=$(ifconfig enp2s0 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
43 IPADDR1_CIDR=$(mask2cidr $IPADDR1_MASK)
44 IPADDR2_MASK=$(ifconfig enp3s0 | grep "Mask" | awk '{print $4}' | awk -F ":" '{print $2}')
45 IPADDR2_CIDR=$(mask2cidr $IPADDR2_MASK)
49 ifconfig enp2s0 hw ether $FAKE_HWADDR1
50 ifconfig enp3s0 hw ether $FAKE_HWADDR2
51 ip addr flush dev enp2s0
52 ip addr flush dev enp3s0
55 vppctl tap connect tap111 hwaddr $HWADDR1
56 vppctl tap connect tap222 hwaddr $HWADDR2
57 vppctl set int ip address tapcli-0 $IPADDR1"/"$IPADDR1_CIDR
58 vppctl set int ip address tapcli-1 $IPADDR2"/"$IPADDR2_CIDR
59 vppctl set int state tapcli-0 up
60 vppctl set int state tapcli-1 up
62 brctl addif br0 tap111
63 brctl addif br0 enp2s0
65 brctl addif br1 tap222
66 brctl addif br1 enp3s0
72 VERSION=$(cat /opt/config/demo_artifacts_version.txt)
73 mkdir -p /var/lib/honeycomb/persist/{config,context}/
74 echo "" > /var/lib/honeycomb/persist/context/data.json
75 echo "" > /var/lib/honeycomb/persist/config/data.json
76 # /opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
77 systemctl restart honeycomb
81 cd /opt/VES/evel/evel-library/code/VESreporting/
82 ./go-client.sh &>/dev/null &disown