lisp_ip6.sh revision 46e4b31a
1#!/usr/bin/env bash
2
3function ping_lisp6 {
4  local RESULTS
5  RESULTS=$(ssh_tg "ping6 -c 10 6:0:2::2")
6  if [ $? -ne 0 ] ; then
7      echo "Can not ping other machine"
8      ssh_vpp1 "sudo rm -r ${TMP_DIR}"
9      ssh_vpp2 "sudo rm -r ${TMP_DIR}"
10      exit -1
11  fi
12}
13
14post_curl "add-mapping" ${ODL_ADD_CONFIG1_6}
15post_curl "add-mapping" ${ODL_ADD_CONFIG2_6}
16
17rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1_6} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
18rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2_6} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
19
20ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_6.conf"
21ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_6.conf"
22
23ssh_tg "sudo ip addr add 6:0:1::2/64 dev ${TG_INT1}"
24ssh_tg "sudo ip link set ${TG_INT1} up"
25ssh_tg "sudo ip route add 6:0:2::0/64 via 6:0:1::1 || exit 0"
26ssh_tg "sudo ip netns exec net2 ip addr add 6:0:2::2/64 dev ${TG_INT2}"
27ssh_tg "sudo ip netns exec net2 ip link set lo up"
28ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
29ssh_tg "sudo ip netns exec net2 ip route add 6:0:1::/64 via 6:0:2::1"
30
31ping_lisp6
32
33rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2_6}  ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
34
35ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
36
37post_curl "update-mapping" ${ODL_REPLACE_CONFIG2_6}
38
39ping_lisp6
40