From 2a937932642f3e8288d338c6fa4a2b6a7a5defc2 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 14 Jan 2016 17:42:49 +0800 Subject: add step to execute gw_mac_update.sh after apex deployed Change-Id: I47c316e26ff8e597c781562645397335e8c5bd70 Signed-off-by: bob zhou Signed-off-by: Tim Rozet --- lib/installer/onos/onos_gw_mac_update.sh | 56 ++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/installer/onos/onos_gw_mac_update.sh (limited to 'lib/installer') diff --git a/lib/installer/onos/onos_gw_mac_update.sh b/lib/installer/onos/onos_gw_mac_update.sh new file mode 100644 index 00000000..d003cc01 --- /dev/null +++ b/lib/installer/onos/onos_gw_mac_update.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Update gateway mac to onos for l3 function + +# author: Bob zhou +# author: Tim Rozet + + +# Update gateway mac to onos for l3 function +# params: external CIDR, external gateway +function onos_update_gw_mac { + local CIDR + local GW_IP + + if [[ -z "$1" || -z "$2" ]]; then + return 1 + else + CIDR=$1 + GW_IP=$2 + fi + + if [ -z "$UNDERCLOUD" ]; then + #if not found then dnsmasq may be using leasefile-ro + instack_mac=$(virsh domiflist instack | grep default | \ + grep -Eo "[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+:[0-9a-f\]+") + UNDERCLOUD=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'}) + fi + # get controller ip address + controller_ip=$(ssh -T ${SSH_OPTIONS[@]} "stack@$UNDERCLOUD" <