Use arping when moving an IP address

This helps fix an issue where an IPv4 address is moved from an interface
and you lose your SSH session.

Change-Id: Idf37ccbaa6f615fcc714d49c3f0c00c893f56021
This commit is contained in:
Sean M. Collins 2016-04-28 13:33:38 -05:00
parent 96ffde28b6
commit 53b63cc97f

View File

@ -859,6 +859,13 @@ function _move_neutron_addresses_route {
IP_BRD=$(ip -f $af a s dev $from_intf scope global primary | grep inet | awk '{ print $2, $3, $4; exit }')
if [[ "$af" == "inet" ]]; then
IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1)
ARP_CMD="arping -A -c 3 -w 4.5 -I $to_intf $IP "
else
ARP_CMD=""
fi
if [ "$DEFAULT_ROUTE_GW" != "" ]; then
ADD_DEFAULT_ROUTE="sudo ip -f $af r replace default via $DEFAULT_ROUTE_GW dev $to_intf"
fi
@ -879,7 +886,7 @@ function _move_neutron_addresses_route {
# The add/del OVS port calls have to happen either before or
# after the address is moved in order to not leave it orphaned.
$DEL_OVS_PORT; $IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE
$DEL_OVS_PORT; $IP_DEL; $IP_ADD; $IP_UP; $ADD_OVS_PORT; $ADD_DEFAULT_ROUTE; $ARP_CMD
fi
}