Skip to content

Commit 6a42a85

Browse files
committed
Fixes for linux bridge and Q_USE_PROVIDER_NET
===Set bridge_mappings for linux bridge=== The external network physnet needs a bridge_mapping to the public bridge when the L2 agent is responsible for wiring. ===Add PUBLIC_PHYSICAL_NETWORK to flat_networks=== This network must be present in the ML2 flat_networks config if flat_networks is specified. ===Set ext_gw_interface to PUBLIC_BRIDGE in provider net case=== ext_gw_interface must be a bridge in a bridge_mapping when Q_USE_PROVIDERNET_FOR_PUBLIC is used. Closes-Bug: #1605423 Change-Id: I95d63f8dfd21499c599d425678bf5327b599efcc
1 parent 8befb78 commit 6a42a85

3 files changed

Lines changed: 21 additions & 5 deletions

File tree

lib/neutron_plugins/linuxbridge_agent

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ function neutron_plugin_configure_plugin_agent {
6262
if [[ "$LB_INTERFACE_MAPPINGS" == "" ]] && [[ "$PHYSICAL_NETWORK" != "" ]] && [[ "$LB_PHYSICAL_INTERFACE" != "" ]]; then
6363
LB_INTERFACE_MAPPINGS=$PHYSICAL_NETWORK:$LB_PHYSICAL_INTERFACE
6464
fi
65+
if [[ "$PUBLIC_BRIDGE" != "" ]] && [[ "$PUBLIC_PHYSICAL_NETWORK" != "" ]]; then
66+
iniset /$Q_PLUGIN_CONF_FILE linux_bridge bridge_mappings "$PUBLIC_PHYSICAL_NETWORK:$PUBLIC_BRIDGE"
67+
fi
6568
if [[ "$LB_INTERFACE_MAPPINGS" != "" ]]; then
6669
iniset /$Q_PLUGIN_CONF_FILE linux_bridge physical_interface_mappings $LB_INTERFACE_MAPPINGS
6770
fi

lib/neutron_plugins/ml2

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,16 @@ function neutron_plugin_configure_service {
9595

9696

9797
# Allow for setup the flat type network
98-
if [[ -z "$Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS" && -n "$PHYSICAL_NETWORK" ]]; then
99-
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS="flat_networks=$PHYSICAL_NETWORK"
98+
if [[ -z "$Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS" ]]; then
99+
if [[ -n "$PHYSICAL_NETWORK" || -n "$PUBLIC_PHYSICAL_NETWORK" ]]; then
100+
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS="flat_networks="
101+
if [[ -n "$PHYSICAL_NETWORK" ]]; then
102+
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS+="${PHYSICAL_NETWORK},"
103+
fi
104+
if [[ -n "$PUBLIC_PHYSICAL_NETWORK" ]]; then
105+
Q_ML2_PLUGIN_FLAT_TYPE_OPTIONS+="${PUBLIC_PHYSICAL_NETWORK},"
106+
fi
107+
fi
100108
fi
101109
# REVISIT(rkukura): Setting firewall_driver here for
102110
# neutron.agent.securitygroups_rpc.is_firewall_enabled() which is

lib/neutron_plugins/services/l3

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,15 @@ function _neutron_configure_router_v4 {
306306
if is_neutron_ovs_base_plugin; then
307307
ext_gw_interface=$(_neutron_get_ext_gw_interface)
308308
elif [[ "$Q_AGENT" = "linuxbridge" ]]; then
309-
# Search for the brq device the neutron router and network for $FIXED_RANGE
309+
# Get the device the neutron router and network for $FIXED_RANGE
310310
# will be using.
311-
# e.x. brq3592e767-da for NET_ID 3592e767-da66-4bcb-9bec-cdb03cd96102
312-
ext_gw_interface=brq${EXT_NET_ID:0:11}
311+
if [ "$Q_USE_PROVIDERNET_FOR_PUBLIC" = "True" ]; then
312+
# in provider nets a bridge mapping uses the public bridge directly
313+
ext_gw_interface=$PUBLIC_BRIDGE
314+
else
315+
# e.x. brq3592e767-da for NET_ID 3592e767-da66-4bcb-9bec-cdb03cd96102
316+
ext_gw_interface=brq${EXT_NET_ID:0:11}
317+
fi
313318
fi
314319
if [[ "$ext_gw_interface" != "none" ]]; then
315320
local cidr_len=${FLOATING_RANGE#*/}

0 commit comments

Comments
 (0)