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:
parent
efe3d3cf19
commit
b4248a51b6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user