aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/vFW/scripts/v_firewall_init.sh
diff options
context:
space:
mode:
authorplatania <platania@research.att.com>2017-02-16 11:20:22 -0500
committerplatania <platania@research.att.com>2017-02-16 11:20:47 -0500
commit3426556541256f93d2cba65df3b9c8d1d1772861 (patch)
tree56e5b26481400d35e3e2e36be20df953793e348d /vnfs/vFW/scripts/v_firewall_init.sh
parentf525cb9014ae27ddd795f933dee54a78b214a589 (diff)
Initial OpenECOMP Demo commit
Change-Id: Ibf8696196a7ac2c84ac8aa7cde1982c9c89fb64d Signed-off-by: platania <platania@research.att.com>
Diffstat (limited to 'vnfs/vFW/scripts/v_firewall_init.sh')
-rw-r--r--vnfs/vFW/scripts/v_firewall_init.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/vnfs/vFW/scripts/v_firewall_init.sh b/vnfs/vFW/scripts/v_firewall_init.sh
new file mode 100644
index 00000000..fe16cef5
--- /dev/null
+++ b/vnfs/vFW/scripts/v_firewall_init.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+# Start VPP
+start vpp
+sleep 1
+
+# Configure VPP for vFirewall
+IPADDR1=$(ifconfig eth1 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+IPADDR2=$(ifconfig eth2 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+HWADDR1=$(ifconfig eth1 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
+HWADDR2=$(ifconfig eth2 | grep HWaddr | tr -s ' ' | cut -d' ' -f5)
+FAKE_HWADDR1=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
+FAKE_HWADDR2=$(echo -n 00; dd bs=1 count=5 if=/dev/urandom 2>/dev/null | hexdump -v -e '/1 ":%02X"')
+
+ifconfig eth1 down
+ifconfig eth2 down
+ifconfig eth1 hw ether $FAKE_HWADDR1
+ifconfig eth2 hw ether $FAKE_HWADDR2
+ip addr flush dev eth1
+ip addr flush dev eth2
+ifconfig eth1 up
+ifconfig eth2 up
+vppctl tap connect tap111 hwaddr $HWADDR1
+vppctl tap connect tap222 hwaddr $HWADDR2
+vppctl set int ip address tap-0 $IPADDR1"/24"
+vppctl set int ip address tap-1 $IPADDR2"/24"
+vppctl set int state tap-0 up
+vppctl set int state tap-1 up
+brctl addbr br0
+brctl addif br0 tap111
+brctl addif br0 eth1
+brctl addbr br1
+brctl addif br1 tap222
+brctl addif br1 eth2
+ifconfig br0 up
+ifconfig br1 up
+sleep 1
+
+# Start HoneyComb
+echo "" > /var/lib/honeycomb/persist/context/data.json
+echo "" > /var/lib/honeycomb/persist/config/data.json
+/opt/honeycomb/sample-distribution-1.0.0/honeycomb &>/dev/null &disown
+sleep 1
+
+# Start VES client
+cd /opt/VES/code/evel_training/VESreporting/
+./go-client.sh &>/dev/null &disown