From 95469032656c442982730ea307644d47d7755a81 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 8 Sep 2016 17:08:36 -0700 Subject: [PATCH] Set sensible default for LB_PHYSICAL_INT Configure the linux bridge physical interface to use the interface for the default route on the current host. In the future we should consider using a dangling interface so that we aren't affecting the host instances networking but this roughly matches what testing has been using in the past. Change-Id: I7859437f97e6cab929e90208fe56f7efd62dfe01 --- lib/neutron-legacy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index b1b5230fdd..1b7c4db507 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -211,13 +211,15 @@ PHYSICAL_NETWORK=${PHYSICAL_NETWORK:-public} # Example: ``OVS_PHYSICAL_BRIDGE=br-eth1`` OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-br-ex} +default_route_dev=$(ip route | grep ^default | awk '{print $5}') +die_if_not_set $LINENO default_route_dev "Failure retrieving default route device" # With the linuxbridge agent, if using VLANs for tenant networks, # or if using flat or VLAN provider networks, set in ``localrc`` to # the name of the network interface to use for the physical # network. # # Example: ``LB_PHYSICAL_INTERFACE=eth1`` -LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-} +LB_PHYSICAL_INTERFACE=${LB_PHYSICAL_INTERFACE:-$default_route_dev} # When Neutron tunnels are enabled it is needed to specify the # IP address of the end point in the local server. This IP is set