5 # path to vpp executable and configurations folder
6 # VPP_LITE_BIN=/vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
7 VPP_LITE_BIN=/home/csit/lisp_vpp/build-root/install-vpp_lite_debug-native/vpp/bin/vpp
8 VPP_LITE_CONF=`pwd`"/../configs/vpp_lite_config/"
11 ODL_CONFIG_DIR="../configs/odl/"
12 ODL_ADD_CONFIG1="add_ipv4_odl1.txt"
13 ODL_ADD_CONFIG1_6="add_ipv6_odl1.txt"
14 ODL_ADD_CONFIG2="add_ipv4_odl2.txt"
15 ODL_ADD_CONFIG2_6="add_ipv6_odl2.txt"
16 ODL_REPLACE_CONFIG2="replace_ipv4_odl2.txt"
17 ODL_REPLACE_CONFIG2_6="replace_ipv6_odl2.txt"
24 # make sure there are no vpp instances running
27 # delete previous incarnations if they exist
28 sudo ip netns exec intervppns ifconfig vppbr down
29 sudo ip netns exec intervppns brctl delbr vppbr
30 sudo ip link del dev veth_vpp1 &> /dev/null
31 sudo ip link del dev veth_vpp2 &> /dev/null
32 sudo ip link del dev veth_intervpp1 &> /dev/null
33 sudo ip link del dev veth_intervpp2 &> /dev/null
34 sudo ip link del dev veth_odl &> /dev/null
35 sudo ip netns del vppns1 &> /dev/null
36 sudo ip netns del vppns2 &> /dev/null
37 sudo ip netns del intervppns &> /dev/null
39 if [ "$1" == "clean" ] ; then
43 # create vpp to clients and inter-vpp namespaces
44 sudo ip netns add vppns1
45 sudo ip netns add vppns2
46 sudo ip netns add intervppns
48 # create vpp and odl interfaces and set them in intervppns
49 sudo ip link add veth_intervpp1 type veth peer name intervpp1
50 sudo ip link add veth_intervpp2 type veth peer name intervpp2
51 sudo ip link add veth_odl type veth peer name odl
52 sudo ip link set dev intervpp1 up
53 sudo ip link set dev intervpp2 up
54 sudo ip link set dev odl up
55 sudo ip link set dev veth_intervpp1 up netns intervppns
56 sudo ip link set dev veth_intervpp2 up netns intervppns
57 sudo ip link set dev veth_odl up netns intervppns
59 # create bridge in intervppns and add vpp and odl interfaces
60 sudo ip netns exec intervppns brctl addbr vppbr
61 sudo ip netns exec intervppns brctl addif vppbr veth_intervpp1
62 sudo ip netns exec intervppns brctl addif vppbr veth_intervpp2
63 sudo ip netns exec intervppns brctl addif vppbr veth_odl
64 sudo ip netns exec intervppns ifconfig vppbr up
66 # create and configure 1st veth client to vpp pair
67 sudo ip link add veth_vpp1 type veth peer name vpp1
68 sudo ip link set dev vpp1 up
69 sudo ip link set dev veth_vpp1 up netns vppns1
71 # create and configure 2nd veth client to vpp pair
72 sudo ip link add veth_vpp2 type veth peer name vpp2
73 sudo ip link set dev vpp2 up
74 sudo ip link set dev veth_vpp2 up netns vppns2
76 # set odl iface ip and disable checksum offloading
77 sudo ip addr add 6.0.3.100/24 dev odl
78 sudo ip addr add 6:0:3::100/64 dev odl
79 sudo ethtool --offload odl rx off tx off
81 if [ "$1" == "ip6" ] ; then
82 VPP1_CONF="vpp1_6.conf"
83 VPP2_CONF="vpp2_6.conf"
86 if [ "$1" == "all" ] ; then
87 VPP1_CONF="vpp1_ip4_6.conf"
88 VPP2_CONF="vpp2_ip4_6.conf"
91 # start vpp1 and vpp2 in separate chroot
93 unix { log /tmp/vpp1.log cli-listen \
94 localhost:5002 full-coredump \
95 exec $VPP_LITE_CONF/${VPP1_CONF} } \
96 api-trace { on } chroot {prefix xtr1}
99 unix { log /tmp/vpp2.log cli-listen \
100 localhost:5003 full-coredump \
101 exec $VPP_LITE_CONF/${VPP2_CONF}} \
102 api-trace { on } chroot {prefix xtr2}
105 if [ "$#" == 0 ] || [ "$1" == "ip4" ] ; then
109 if [ "$1" == "ip6" ] ; then
113 if [ "$1" == "all" ] ; then