lisp_6_remote.sh revision d746f963
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
14rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG1} ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_6.conf
15rsync -avz ${VPP_CONFIG_DIR}${VPP_CONFIG2} ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_6.conf
16
17ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_6.conf"
18ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_6.conf"
19
20ssh_tg "sudo ip addr add 6:0:1::2/64 dev ${TG_INT1}"
21ssh_tg "sudo ip link set ${TG_INT1} up"
22ssh_tg "sudo ip route add 6:0:2::0/64 via 6:0:1::1 || exit 0"
23ssh_tg "sudo ip netns exec net2 ip addr add 6:0:2::2/64 dev ${TG_INT2}"
24ssh_tg "sudo ip netns exec net2 ip link set lo up"
25ssh_tg "sudo ip netns exec net2 ip link set ${TG_INT2} up"
26ssh_tg "sudo ip netns exec net2 ip route add 6:0:1::/64 via 6:0:2::1"
27
28ping_lisp6
29
30rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF1}  ${USER}@${VPP1_IP}:${TMP_DIR}/vpp1_reconf.conf
31rsync -avz ${VPP_CONFIG_DIR}${VPP_RECONF2}  ${USER}@${VPP2_IP}:${TMP_DIR}/vpp2_reconf_6.conf
32
33ssh_vpp1 "sudo vpp_api_test < ${TMP_DIR}/vpp1_reconf.conf"
34ssh_vpp2 "sudo vpp_api_test < ${TMP_DIR}/vpp2_reconf_6.conf"
35
36ping_lisp6
37