3 source topologies/multihoming_topo_l2.sh
5 ODL_CONFIG_FILE1="vpp1.json"
6 ODL_CONFIG_FILE2="vpp2.json"
7 ODL_CONFIG_FILE3="update_vpp2.json"
9 if [ "$1" == "clean" ] ; then
10 multihoming_topo_clean
14 if [[ $(id -u) != 0 ]]; then
15 echo "Error: run this as a root."
19 function test_multihoming
21 if [ "$3" != "no_setup" ] ; then
22 multihoming_topo_setup
29 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
31 if [ $rc -ne 0 ] ; then
32 echo "No response received!"
35 multihoming_topo_clean
41 # do some port sweeping to see that load balancing works
42 ip netns exec vppns1 python scripts/port_flood.py "${2}" 1000
45 pkts=$(echo "show int" | nc 0 5003 | grep host-intervpp12 | awk '{print $6}' | tr -d '\r')
47 if [ $pkts -gt 450 ] && [ $pkts -lt 550 ] ; then
53 if [ $rc -ne 0 ] ; then
54 echo "Load balancing doesn't work!"
58 multihoming_topo_clean
64 # change IP addresses of destination RLOC
65 echo "set int ip address del host-intervpp12 6.0.3.2/24" | nc 0 5003
66 echo "set int ip address host-intervpp12 6.0.3.20/24" | nc 0 5003
67 echo "set int ip address del host-intervpp12 6:0:3::2/64" | nc 0 5003
68 echo "set int ip address host-intervpp12 6:0:3::20/64" | nc 0 5003
69 post_curl "update-mapping" ${ODL_CONFIG_FILE3}
71 ip netns exec vppns1 "${1}" -w 15 -c 1 "${2}"
78 multihoming_topo_clean
79 print_status $rc "No ICMP response!"