From 71947d5fd05c3609417351ab37b9ac24b0eae9ef Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Wed, 17 Jun 2015 17:33:02 -0400 Subject: [PATCH] Fixes for Linux Bridge in the L3 agent Prior to this patch, the logic for configuring the interface used for the L3 agent was OVS specific. This patch introduces code to correctly identify the brq device that is used for the L3 agent when using the Linux Bridge mechanism driver. Change-Id: I1a36cad0fb790aaa37417a1176576293e4f2c87f Co-Authored-By: Jens Rosenboom --- lib/neutron-legacy | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index 4cfb026ae2..ee72b600d7 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -1267,9 +1267,19 @@ function _neutron_configure_router_v4 { # This logic is specific to using the l3-agent for layer 3 if is_service_enabled q-l3; then # Configure and enable public bridge + local ext_gw_interface="none" if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then - local ext_gw_interface=$(_neutron_get_ext_gw_interface) + ext_gw_interface=$(_neutron_get_ext_gw_interface) + elif [[ "$Q_AGENT" = "linuxbridge" ]]; then + # Search for the brq device the neutron router and network for $FIXED_RANGE + # will be using. + # e.x. brq3592e767-da for NET_ID 3592e767-da66-4bcb-9bec-cdb03cd96102 + ext_gw_interface=brq${EXT_NET_ID:0:11} + fi + if [[ "$ext_gw_interface" != "none" ]]; then local cidr_len=${FLOATING_RANGE#*/} + local testcmd="ip -o link | grep -q $ext_gw_interface" + test_with_retry "$testcmd" "$ext_gw_interface creation failed" if [[ $(ip addr show dev $ext_gw_interface | grep -c $ext_gw_ip) == 0 && ( $Q_USE_PROVIDERNET_FOR_PUBLIC == "False" || $Q_USE_PUBLIC_VETH == "True" ) ]]; then sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface sudo ip link set $ext_gw_interface up