Nova: Update compute start script to accomodate multiple default routes

This PS udpates the nova compute start script to account for cases where
there may be multiple default routes to the outside world.

Change-Id: Ibd051c2577a0ab67aa2a5284fc9ccab799c28953
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2019-11-26 15:02:46 -06:00
parent efe3d3cf19
commit b4248a51b6
2 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@ fi
if [ -z "${client_address}" ] ; then
if [ -z "${client_interface}" ] ; then
# search for interface with default routing
client_interface=$(ip r | grep default | awk '{print $5}')
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
fi
# determine client ip dynamically based on interface provided

View File

@ -32,8 +32,8 @@ fi
if [ -z "${client_address}" ] ; then
if [ -z "${client_interface}" ] ; then
# search for interface with default routing
client_interface=$(ip r | grep default | awk '{print $5}')
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
fi
# determine client ip dynamically based on interface provided