1 # path to vpp executable and configurations folder
2 VPP_LITE_BIN=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
3 VPP_LITE_CONF=/etc/vpp/lite/
5 # make sure there are no vpp instances running
8 # delete previous incarnations if they exist
9 ip netns exec intervppns ifconfig vppbr down
10 ip netns exec intervppns brctl delbr vppbr
11 ip link del dev veth_vpp1 &> /dev/null
12 ip link del dev veth_vpp2 &> /dev/null
13 ip link del dev veth_intervpp1 &> /dev/null
14 ip link del dev veth_intervpp2 &> /dev/null
15 ip link del dev veth_odl &> /dev/null
16 ip netns del vppns1 &> /dev/null
17 ip netns del vppns2 &> /dev/null
18 ip netns del intervppns &> /dev/null
20 if [ "$1" == "clean" ] ; then
24 # create vpp to clients and inter-vpp namespaces
27 ip netns add intervppns
29 # create vpp and odl interfaces and set them in intervppns
30 ip link add veth_intervpp1 type veth peer name intervpp1
31 ip link add veth_intervpp2 type veth peer name intervpp2
32 ip link add veth_odl type veth peer name odl
33 ip link set dev intervpp1 up
34 ip link set dev intervpp2 up
35 ip link set dev odl up
36 ip link set dev veth_intervpp1 up netns intervppns
37 ip link set dev veth_intervpp2 up netns intervppns
38 ip link set dev veth_odl up netns intervppns
40 # create bridge in intervppns and add vpp and odl interfaces
41 ip netns exec intervppns brctl addbr vppbr
42 ip netns exec intervppns brctl addif vppbr veth_intervpp1
43 ip netns exec intervppns brctl addif vppbr veth_intervpp2
44 ip netns exec intervppns brctl addif vppbr veth_odl
45 ip netns exec intervppns ifconfig vppbr up
47 # create and configure 1st veth client to vpp pair
48 ip link add veth_vpp1 type veth peer name vpp1
49 ip link set dev vpp1 up
50 ip link set dev veth_vpp1 up netns vppns1
52 ip netns exec vppns1 \
55 ip addr add 6.0.2.2/24 dev veth_vpp1
56 ip route add 6.0.4.0/24 via 6.0.2.1
59 # create and configure 2nd veth client to vpp pair
60 ip link add veth_vpp2 type veth peer name vpp2
61 ip link set dev vpp2 up
62 ip link set dev veth_vpp2 up netns vppns2
64 ip netns exec vppns2 \
67 ip addr add 6.0.4.4/24 dev veth_vpp2
68 ip route add 6.0.2.0/24 via 6.0.4.1
71 # set odl iface ip and disable checksum offloading
72 ifconfig odl 6.0.3.100/24
73 ethtool --offload odl rx off tx off
75 # start vpp1 and vpp2 in separate chroot
77 unix { log /tmp/vpp1.log cli-listen \
78 localhost:5002 full-coredump \
79 exec $VPP_LITE_CONF/vpp1.conf } \
80 api-trace { on } chroot {prefix xtr1}
83 unix { log /tmp/vpp2.log cli-listen \
84 localhost:5003 full-coredump \
85 exec $VPP_LITE_CONF/vpp2.conf} \
86 api-trace { on } chroot {prefix xtr2}