4 apt-get install -y sudo curl net-tools iproute2
5 curl -s https://packagecloud.io/install/repositories/fdio/release/script.deb.sh | sudo bash
6 export VPP_VER=19.01.2-release
7 apt-get install -y vpp=$VPP_VER vpp-lib=$VPP_VER
8 apt-get install -y vpp-plugins=$VPP_VER
10 if [ -e /run/vpp/cli-vpp2.sock ]; then
11 rm /run/vpp/cli-vpp2.sock
15 # root@vpktgen:/# taskset -p --cpu-list 1
16 # pid 1's current affinity list: 1,2,29
18 corelist=`taskset -p -c 1 |cut -d : -f 2 | sed 's/^ *//' | sed 's/ *$//'`
20 mastercoreidx=`echo $corelist | cut -d , -f 1`
22 workercorelist=`echo $corelist | sed -E 's/^[0-9]*,//'`
25 vpp unix {cli-listen /run/vpp/cli-vpp2.sock} api-segment { prefix vpp2 } \
26 cpu { main-core $mastercoreidx corelist-workers $workercorelist }
28 echo 'wait vpp be up ...'
29 while [ ! -e /run/vpp/cli-vpp2.sock ]; do
33 echo 'configure vpp ...'
35 ifconfig veth12 0.0.0.0
37 ifconfig veth21 0.0.0.0
40 HWADDR1=$(ifconfig veth12 |grep ether | tr -s ' ' | cut -d' ' -f 3)
41 HWADDR2=$(ifconfig veth21 |grep ether | tr -s ' ' | cut -d' ' -f 3)
43 vppctl -s /run/vpp/cli-vpp2.sock show ver
44 vppctl -s /run/vpp/cli-vpp2.sock show threads
46 vppctl -s /run/vpp/cli-vpp2.sock create host-interface name veth12 hw-addr $HWADDR1
48 vppctl -s /run/vpp/cli-vpp2.sock set int state host-veth12 up
50 vppctl -s /run/vpp/cli-vpp2.sock set int ip address host-veth12 10.10.1.1/24
52 vppctl -s /run/vpp/cli-vpp2.sock create host-interface name veth21 hw-addr $HWADDR2
54 vppctl -s /run/vpp/cli-vpp2.sock set int state host-veth21 up
56 vppctl -s /run/vpp/cli-vpp2.sock set int ip address host-veth21 10.10.2.1/24
58 vppctl -s /run/vpp/cli-vpp2.sock show hardware
59 vppctl -s /run/vpp/cli-vpp2.sock show int
60 vppctl -s /run/vpp/cli-vpp2.sock show int addr
62 vppctl -s /run/vpp/cli-vpp2.sock show ip fib
64 #vppctl -s /run/vpp/cli-vpp2.sock trace add af-packet-input 10
66 #vppctl -s /run/vpp/cli-vpp2.sock ping 10.10.1.2
68 #vppctl -s /run/vpp/cli-vpp2.sock show trace
69 #vppctl -s /run/vpp/cli-vpp2.sock show ip arp