aboutsummaryrefslogtreecommitdiffstats
path: root/starlingx/demo/firewall-host-netdevice/resources
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2020-02-22 13:20:45 +0800
committerBin Yang <bin.yang@windriver.com>2020-02-23 16:07:49 +0800
commit0a13e91612de5fa590bdecb7b17ef79e7f220131 (patch)
treede70ab3ebd60e343be2c77d9282789cedce3eeaf /starlingx/demo/firewall-host-netdevice/resources
parentbea5027a7f59bffee2a6ed931e63c05a9fb1bdc7 (diff)
Add helm chart for cFW CNF
specific to networking backended by host netdevice Change-Id: I26201b9d3e1c2434ba126fc497afffbaf58057a8 Issue-ID: MULTICLOUD-999 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'starlingx/demo/firewall-host-netdevice/resources')
-rw-r--r--starlingx/demo/firewall-host-netdevice/resources/scripts/init/vfw_start.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/starlingx/demo/firewall-host-netdevice/resources/scripts/init/vfw_start.sh b/starlingx/demo/firewall-host-netdevice/resources/scripts/init/vfw_start.sh
new file mode 100644
index 00000000..fd44793e
--- /dev/null
+++ b/starlingx/demo/firewall-host-netdevice/resources/scripts/init/vfw_start.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+apt-get update
+apt-get install -y sudo curl net-tools iproute2
+curl -s https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | sudo bash
+export VPP_VER=19.01.2-release
+apt-get install -y vpp=$VPP_VER vpp-lib=$VPP_VER
+apt-get install -y vpp-plugins=$VPP_VER
+
+if [ -e /run/vpp/cli-vpp2.sock ]; then
+ rm /run/vpp/cli-vpp2.sock
+fi
+
+# extract core list
+# root@vpktgen:/# taskset -p --cpu-list 1
+# pid 1's current affinity list: 1,2,29
+
+corelist=`taskset -p -c 1 |cut -d : -f 2 | sed 's/^ *//' | sed 's/ *$//'`
+#extract master core
+mastercoreidx=`echo $corelist | cut -d , -f 1`
+#extract worker cores
+workercorelist=`echo $corelist | sed -E 's/^[0-9]*,//'`
+
+echo 'start... vpp'
+vpp unix {cli-listen /run/vpp/cli-vpp2.sock} api-segment { prefix vpp2 } \
+ cpu { main-core $mastercoreidx corelist-workers $workercorelist }
+
+echo 'wait vpp be up ...'
+while [ ! -e /run/vpp/cli-vpp2.sock ]; do
+ sleep 1;
+done
+
+echo 'configure vpp ...'
+
+vppctl -s /run/vpp/cli-vpp2.sock show ver
+vppctl -s /run/vpp/cli-vpp2.sock show threads
+
+vppctl -s /run/vpp/cli-vpp2.sock create host-interface name veth12
+
+vppctl -s /run/vpp/cli-vpp2.sock set int state host-veth12 up
+
+vppctl -s /run/vpp/cli-vpp2.sock set int ip address host-veth12 10.10.1.1/24
+
+vppctl -s /run/vpp/cli-vpp2.sock create host-interface name veth21
+
+vppctl -s /run/vpp/cli-vpp2.sock set int state host-veth21 up
+
+vppctl -s /run/vpp/cli-vpp2.sock set int ip address host-veth21 10.10.2.1/24
+
+vppctl -s /run/vpp/cli-vpp2.sock show hardware
+vppctl -s /run/vpp/cli-vpp2.sock show int
+vppctl -s /run/vpp/cli-vpp2.sock show int addr
+
+vppctl -s /run/vpp/cli-vpp2.sock show ip fib
+
+#vppctl -s /run/vpp/cli-vpp2.sock trace add af-packet-input 10
+
+#vppctl -s /run/vpp/cli-vpp2.sock ping 10.10.1.2
+
+#vppctl -s /run/vpp/cli-vpp2.sock show trace
+#vppctl -s /run/vpp/cli-vpp2.sock show ip arp
+
+echo "done"
+sleep infinity