blob: 177dc1f028da39c4eefd88aba88d6fb4549e3c8f [file] [log] [blame]
Sean M. Collins2a242512016-05-03 09:03:09 -04001#!/bin/bash
2# Subnet IP version
3IP_VERSION=${IP_VERSION:-"4+6"}
4# Validate IP_VERSION
5if [[ $IP_VERSION != "4" ]] && [[ $IP_VERSION != "6" ]] && [[ $IP_VERSION != "4+6" ]]; then
6 die $LINENO "IP_VERSION must be either 4, 6, or 4+6"
7fi
8# Specify if the initial private and external networks should be created
9NEUTRON_CREATE_INITIAL_NETWORKS=${NEUTRON_CREATE_INITIAL_NETWORKS:-True}
10
11## Provider Network Information
12PROVIDER_SUBNET_NAME=${PROVIDER_SUBNET_NAME:-"provider_net"}
13IPV6_PROVIDER_SUBNET_NAME=${IPV6_PROVIDER_SUBNET_NAME:-"provider_net_v6"}
14IPV6_PROVIDER_FIXED_RANGE=${IPV6_PROVIDER_FIXED_RANGE:-}
15IPV6_PROVIDER_NETWORK_GATEWAY=${IPV6_PROVIDER_NETWORK_GATEWAY:-}
16
17PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
18
19# If Q_USE_PUBLIC_VETH=True, create and use a veth pair instead of
20# PUBLIC_BRIDGE. This is intended to be used with
21# Q_USE_PROVIDERNET_FOR_PUBLIC=True.
22Q_USE_PUBLIC_VETH=${Q_USE_PUBLIC_VETH:-False}
23Q_PUBLIC_VETH_EX=${Q_PUBLIC_VETH_EX:-veth-pub-ex}
24Q_PUBLIC_VETH_INT=${Q_PUBLIC_VETH_INT:-veth-pub-int}
25
26# The next two variables are configured by plugin
27# e.g. _configure_neutron_l3_agent or lib/neutron_plugins/*
28#
29# The plugin supports L3.
30Q_L3_ENABLED=${Q_L3_ENABLED:-True}
31# L3 routers exist per tenant
32Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-True}
33
34
35# Use flat providernet for public network
36#
37# If Q_USE_PROVIDERNET_FOR_PUBLIC=True, use a flat provider network
38# for external interface of neutron l3-agent. In that case,
39# PUBLIC_PHYSICAL_NETWORK specifies provider:physical_network value
40# used for the network. In case of ofagent, you should add the
41# corresponding entry to your OFAGENT_PHYSICAL_INTERFACE_MAPPINGS.
42# For openvswitch agent, you should add the corresponding entry to
43# your OVS_BRIDGE_MAPPINGS.
44#
45# eg. (ofagent)
46# Q_USE_PROVIDERNET_FOR_PUBLIC=True
47# Q_USE_PUBLIC_VETH=True
48# PUBLIC_PHYSICAL_NETWORK=public
49# OFAGENT_PHYSICAL_INTERFACE_MAPPINGS=public:veth-pub-int
50#
51# eg. (openvswitch agent)
52# Q_USE_PROVIDERNET_FOR_PUBLIC=True
53# PUBLIC_PHYSICAL_NETWORK=public
54# OVS_BRIDGE_MAPPINGS=public:br-ex
55Q_USE_PROVIDERNET_FOR_PUBLIC=${Q_USE_PROVIDERNET_FOR_PUBLIC:-False}
56PUBLIC_PHYSICAL_NETWORK=${PUBLIC_PHYSICAL_NETWORK:-public}
57
58# Generate 40-bit IPv6 Global ID to comply with RFC 4193
59IPV6_GLOBAL_ID=`uuidgen | sed s/-//g | cut -c 23- | sed -e "s/\(..\)\(....\)\(....\)/\1:\2:\3/"`
60
61# IPv6 gateway and subnet defaults, in case they are not customized in localrc
62IPV6_RA_MODE=${IPV6_RA_MODE:-slaac}
63IPV6_ADDRESS_MODE=${IPV6_ADDRESS_MODE:-slaac}
64IPV6_PUBLIC_SUBNET_NAME=${IPV6_PUBLIC_SUBNET_NAME:-ipv6-public-subnet}
65IPV6_PRIVATE_SUBNET_NAME=${IPV6_PRIVATE_SUBNET_NAME:-ipv6-private-subnet}
66FIXED_RANGE_V6=${FIXED_RANGE_V6:-fd$IPV6_GLOBAL_ID::/64}
67IPV6_PRIVATE_NETWORK_GATEWAY=${IPV6_PRIVATE_NETWORK_GATEWAY:-fd$IPV6_GLOBAL_ID::1}
68IPV6_PUBLIC_RANGE=${IPV6_PUBLIC_RANGE:-2001:db8::/64}
69IPV6_PUBLIC_NETWORK_GATEWAY=${IPV6_PUBLIC_NETWORK_GATEWAY:-2001:db8::2}
70IPV6_ROUTER_GW_IP=${IPV6_ROUTER_GW_IP:-2001:db8::1}
71
72# Gateway and subnet defaults, in case they are not customized in localrc
73NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
74PUBLIC_NETWORK_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.1}
75PRIVATE_SUBNET_NAME=${PRIVATE_SUBNET_NAME:-"private-subnet"}
76PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"}
77
78# Subnetpool defaults
79SUBNETPOOL_NAME=${SUBNETPOOL_NAME:-"shared-default-subnetpool"}
80
81SUBNETPOOL_PREFIX_V4=${SUBNETPOOL_PREFIX_V4:-10.0.0.0/8}
82SUBNETPOOL_PREFIX_V6=${SUBNETPOOL_PREFIX_V6:-2001:db8:8000::/48}
83
84SUBNETPOOL_SIZE_V4=${SUBNETPOOL_SIZE_V4:-24}
85SUBNETPOOL_SIZE_V6=${SUBNETPOOL_SIZE_V6:-64}
86
87function _determine_config_l3 {
88 local opts="--config-file $NEUTRON_CONF --config-file=$Q_L3_CONF_FILE"
89 echo "$opts"
90}
91
92function _configure_neutron_l3_agent {
93 local cfg_file
94 Q_L3_ENABLED=True
95
96 cp $NEUTRON_DIR/etc/l3_agent.ini.sample $Q_L3_CONF_FILE
97
98 iniset $Q_L3_CONF_FILE DEFAULT verbose True
99 iniset $Q_L3_CONF_FILE DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
100 iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
101 iniset $Q_L3_CONF_FILE DEFAULT root_helper "$Q_RR_COMMAND"
102 if [[ "$Q_USE_ROOTWRAP_DAEMON" == "True" ]]; then
103 iniset $Q_L3_CONF_FILE agent root_helper_daemon "$Q_RR_DAEMON_COMMAND"
104 fi
105
106 _neutron_setup_interface_driver $Q_L3_CONF_FILE
107
108 neutron_plugin_configure_l3_agent
109
110 if [[ $(ip -f inet a s dev "$PUBLIC_INTERFACE" | grep -c 'global') != 0 ]]; then
111 _move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" True "inet"
112 fi
113
114 if [[ $(ip -f inet6 a s dev "$PUBLIC_INTERFACE" | grep -c 'global') != 0 ]]; then
115 _move_neutron_addresses_route "$PUBLIC_INTERFACE" "$OVS_PHYSICAL_BRIDGE" False "inet6"
116 fi
117}
118
119# Explicitly set router id in l3 agent configuration
120function _neutron_set_router_id {
121 if [[ "$Q_L3_ROUTER_PER_TENANT" == "False" ]]; then
122 iniset $Q_L3_CONF_FILE DEFAULT router_id $ROUTER_ID
123 fi
124}
125
126# Get ext_gw_interface depending on value of Q_USE_PUBLIC_VETH
127function _neutron_get_ext_gw_interface {
128 if [[ "$Q_USE_PUBLIC_VETH" == "True" ]]; then
129 echo $Q_PUBLIC_VETH_EX
130 else
131 # Disable in-band as we are going to use local port
132 # to communicate with VMs
133 sudo ovs-vsctl set Bridge $PUBLIC_BRIDGE \
134 other_config:disable-in-band=true
135 echo $PUBLIC_BRIDGE
136 fi
137}
138
139function create_neutron_initial_network {
140 local project_id
141 project_id=$(openstack project list | grep " demo " | get_field 1)
142 die_if_not_set $LINENO project_id "Failure retrieving project_id for demo"
143
144 # Allow drivers that need to create an initial network to do so here
145 if type -p neutron_plugin_create_initial_network_profile > /dev/null; then
146 neutron_plugin_create_initial_network_profile $PHYSICAL_NETWORK
147 fi
148
149 if is_provider_network; then
150 die_if_not_set $LINENO PHYSICAL_NETWORK "You must specify the PHYSICAL_NETWORK"
151 die_if_not_set $LINENO PROVIDER_NETWORK_TYPE "You must specify the PROVIDER_NETWORK_TYPE"
152 NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create $PHYSICAL_NETWORK --tenant_id $project_id --provider:network_type $PROVIDER_NETWORK_TYPE --provider:physical_network "$PHYSICAL_NETWORK" ${SEGMENTATION_ID:+--provider:segmentation_id $SEGMENTATION_ID} --shared | grep ' id ' | get_field 2)
153 die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $project_id"
154
155 if [[ "$IP_VERSION" =~ 4.* ]]; then
156 SUBNET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create --tenant_id $project_id --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --name $PROVIDER_SUBNET_NAME --gateway $NETWORK_GATEWAY $NET_ID $FIXED_RANGE | grep ' id ' | get_field 2)
157 die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $PROVIDER_SUBNET_NAME $project_id"
158 fi
159
160 if [[ "$IP_VERSION" =~ .*6 ]] && [[ -n "$IPV6_PROVIDER_FIXED_RANGE" ]] && [[ -n "$IPV6_PROVIDER_NETWORK_GATEWAY" ]]; then
161 SUBNET_V6_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create --tenant_id $project_id --ip_version 6 --ipv6-address-mode $IPV6_ADDRESS_MODE --gateway $IPV6_PROVIDER_NETWORK_GATEWAY --name $IPV6_PROVIDER_SUBNET_NAME $NET_ID $IPV6_PROVIDER_FIXED_RANGE | grep 'id' | get_field 2)
162 die_if_not_set $LINENO SUBNET_V6_ID "Failure creating SUBNET_V6_ID for $IPV6_PROVIDER_SUBNET_NAME $project_id"
163 fi
164
165 if [[ $Q_AGENT == "openvswitch" ]]; then
166 sudo ip link set $OVS_PHYSICAL_BRIDGE up
167 sudo ip link set br-int up
168 sudo ip link set $PUBLIC_INTERFACE up
169 fi
170 else
171 NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create --tenant-id $project_id "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
172 die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PRIVATE_NETWORK_NAME $project_id"
173
174 if [[ "$IP_VERSION" =~ 4.* ]]; then
175 # Create IPv4 private subnet
176 SUBNET_ID=$(_neutron_create_private_subnet_v4 $project_id)
177 fi
178
179 if [[ "$IP_VERSION" =~ .*6 ]]; then
180 # Create IPv6 private subnet
181 IPV6_SUBNET_ID=$(_neutron_create_private_subnet_v6 $project_id)
182 fi
183 fi
184
185 AUTO_ALLOCATE_EXT=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" ext-list | grep 'auto-allocated-topology' | get_field 1)
186 SUBNETPOOL_EXT=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" ext-list | grep 'subnet_allocation' | get_field 1)
187 if [[ "$Q_L3_ENABLED" == "True" ]]; then
188 # Create a router, and add the private subnet as one of its interfaces
189 if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
190 # create a tenant-owned router.
191 ROUTER_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-create --tenant-id $project_id $Q_ROUTER_NAME | grep ' id ' | get_field 2)
192 die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $project_id $Q_ROUTER_NAME"
193 else
194 # Plugin only supports creating a single router, which should be admin owned.
195 ROUTER_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
196 die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $Q_ROUTER_NAME"
197 fi
198
199 # if the extension is available, then mark the external
200 # network as default, and provision default subnetpools
201 EXTERNAL_NETWORK_FLAGS="--router:external"
202 if [[ -n $AUTO_ALLOCATE_EXT && -n $SUBNETPOOL_EXT ]]; then
203 EXTERNAL_NETWORK_FLAGS="$EXTERNAL_NETWORK_FLAGS --is-default"
204 if [[ "$IP_VERSION" =~ 4.* ]]; then
205 SUBNETPOOL_V4_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnetpool-create $SUBNETPOOL_NAME --default-prefixlen $SUBNETPOOL_SIZE_V4 --pool-prefix $SUBNETPOOL_PREFIX_V4 --shared --is-default=True | grep ' id ' | get_field 2)
206 fi
207 if [[ "$IP_VERSION" =~ .*6 ]]; then
208 SUBNETPOOL_V6_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnetpool-create $SUBNETPOOL_NAME --default-prefixlen $SUBNETPOOL_SIZE_V6 --pool-prefix $SUBNETPOOL_PREFIX_V6 --shared --is-default=True | grep ' id ' | get_field 2)
209 fi
210 fi
211 # Create an external network, and a subnet. Configure the external network as router gw
212 if [ "$Q_USE_PROVIDERNET_FOR_PUBLIC" = "True" ]; then
213 EXT_NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create "$PUBLIC_NETWORK_NAME" -- $EXTERNAL_NETWORK_FLAGS --provider:network_type=flat --provider:physical_network=${PUBLIC_PHYSICAL_NETWORK} | grep ' id ' | get_field 2)
214 else
215 EXT_NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create "$PUBLIC_NETWORK_NAME" -- $EXTERNAL_NETWORK_FLAGS | grep ' id ' | get_field 2)
216 fi
217 die_if_not_set $LINENO EXT_NET_ID "Failure creating EXT_NET_ID for $PUBLIC_NETWORK_NAME"
218
219 if [[ "$IP_VERSION" =~ 4.* ]]; then
220 # Configure router for IPv4 public access
221 _neutron_configure_router_v4
222 fi
223
224 if [[ "$IP_VERSION" =~ .*6 ]]; then
225 # Configure router for IPv6 public access
226 _neutron_configure_router_v6
227 fi
228 fi
229}
230
231# Create private IPv4 subnet
232function _neutron_create_private_subnet_v4 {
233 local project_id=$1
234 local subnet_params="--tenant-id $project_id "
235 subnet_params+="--ip_version 4 "
236 subnet_params+="--gateway $NETWORK_GATEWAY "
237 subnet_params+="--name $PRIVATE_SUBNET_NAME "
238 subnet_params+="$NET_ID $FIXED_RANGE"
239 local subnet_id
240 subnet_id=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep ' id ' | get_field 2)
241 die_if_not_set $LINENO subnet_id "Failure creating private IPv4 subnet for $project_id"
242 echo $subnet_id
243}
244
245# Create private IPv6 subnet
246function _neutron_create_private_subnet_v6 {
247 local project_id=$1
248 die_if_not_set $LINENO IPV6_RA_MODE "IPV6 RA Mode not set"
249 die_if_not_set $LINENO IPV6_ADDRESS_MODE "IPV6 Address Mode not set"
250 local ipv6_modes="--ipv6-ra-mode $IPV6_RA_MODE --ipv6-address-mode $IPV6_ADDRESS_MODE"
251 local subnet_params="--tenant-id $project_id "
252 subnet_params+="--ip_version 6 "
253 subnet_params+="--gateway $IPV6_PRIVATE_NETWORK_GATEWAY "
254 subnet_params+="--name $IPV6_PRIVATE_SUBNET_NAME "
255 subnet_params+="$NET_ID $FIXED_RANGE_V6 $ipv6_modes"
256 local ipv6_subnet_id
257 ipv6_subnet_id=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep ' id ' | get_field 2)
258 die_if_not_set $LINENO ipv6_subnet_id "Failure creating private IPv6 subnet for $project_id"
259 echo $ipv6_subnet_id
260}
261
262# Create public IPv4 subnet
263function _neutron_create_public_subnet_v4 {
264 local subnet_params+="--ip_version 4 "
265 subnet_params+="${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} "
266 subnet_params+="--gateway $PUBLIC_NETWORK_GATEWAY "
267 subnet_params+="--name $PUBLIC_SUBNET_NAME "
268 subnet_params+="$EXT_NET_ID $FLOATING_RANGE "
269 subnet_params+="-- --enable_dhcp=False"
270 local id_and_ext_gw_ip
271 id_and_ext_gw_ip=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep -e 'gateway_ip' -e ' id ')
272 die_if_not_set $LINENO id_and_ext_gw_ip "Failure creating public IPv4 subnet"
273 echo $id_and_ext_gw_ip
274}
275
276# Create public IPv6 subnet
277function _neutron_create_public_subnet_v6 {
278 local subnet_params="--ip_version 6 "
279 subnet_params+="--gateway $IPV6_PUBLIC_NETWORK_GATEWAY "
280 subnet_params+="--name $IPV6_PUBLIC_SUBNET_NAME "
281 subnet_params+="$EXT_NET_ID $IPV6_PUBLIC_RANGE "
282 subnet_params+="-- --enable_dhcp=False"
283 local ipv6_id_and_ext_gw_ip
284 ipv6_id_and_ext_gw_ip=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep -e 'gateway_ip' -e ' id ')
285 die_if_not_set $LINENO ipv6_id_and_ext_gw_ip "Failure creating an IPv6 public subnet"
286 echo $ipv6_id_and_ext_gw_ip
287}
288
289# Configure neutron router for IPv4 public access
290function _neutron_configure_router_v4 {
291 neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-interface-add $ROUTER_ID $SUBNET_ID
292 # Create a public subnet on the external network
293 local id_and_ext_gw_ip
294 id_and_ext_gw_ip=$(_neutron_create_public_subnet_v4 $EXT_NET_ID)
295 local ext_gw_ip
296 ext_gw_ip=$(echo $id_and_ext_gw_ip | get_field 2)
297 PUB_SUBNET_ID=$(echo $id_and_ext_gw_ip | get_field 5)
298 # Configure the external network as the default router gateway
299 neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-gateway-set $ROUTER_ID $EXT_NET_ID
300
301 # This logic is specific to using the l3-agent for layer 3
302 if is_service_enabled q-l3; then
303 # Configure and enable public bridge
304 local ext_gw_interface="none"
305 if is_neutron_ovs_base_plugin; then
306 ext_gw_interface=$(_neutron_get_ext_gw_interface)
307 elif [[ "$Q_AGENT" = "linuxbridge" ]]; then
308 # Search for the brq device the neutron router and network for $FIXED_RANGE
309 # will be using.
310 # e.x. brq3592e767-da for NET_ID 3592e767-da66-4bcb-9bec-cdb03cd96102
311 ext_gw_interface=brq${EXT_NET_ID:0:11}
312 fi
313 if [[ "$ext_gw_interface" != "none" ]]; then
314 local cidr_len=${FLOATING_RANGE#*/}
315 local testcmd="ip -o link | grep -q $ext_gw_interface"
316 test_with_retry "$testcmd" "$ext_gw_interface creation failed"
317 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
318 sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface
319 sudo ip link set $ext_gw_interface up
320 fi
321 ROUTER_GW_IP=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' ')
322 die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP"
323 sudo ip route replace $FIXED_RANGE via $ROUTER_GW_IP
324 fi
325 _neutron_set_router_id
326 fi
327}
328
329# Configure neutron router for IPv6 public access
330function _neutron_configure_router_v6 {
331 neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-interface-add $ROUTER_ID $IPV6_SUBNET_ID
332 # Create a public subnet on the external network
333 local ipv6_id_and_ext_gw_ip
334 ipv6_id_and_ext_gw_ip=$(_neutron_create_public_subnet_v6 $EXT_NET_ID)
335 local ipv6_ext_gw_ip
336 ipv6_ext_gw_ip=$(echo $ipv6_id_and_ext_gw_ip | get_field 2)
337 local ipv6_pub_subnet_id
338 ipv6_pub_subnet_id=$(echo $ipv6_id_and_ext_gw_ip | get_field 5)
339
340 # If the external network has not already been set as the default router
341 # gateway when configuring an IPv4 public subnet, do so now
342 if [[ "$IP_VERSION" == "6" ]]; then
343 neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-gateway-set $ROUTER_ID $EXT_NET_ID
344 fi
345
346 # This logic is specific to using the l3-agent for layer 3
347 if is_service_enabled q-l3; then
348 # Ensure IPv6 forwarding is enabled on the host
349 sudo sysctl -w net.ipv6.conf.all.forwarding=1
350 # Configure and enable public bridge
351 # Override global IPV6_ROUTER_GW_IP with the true value from neutron
352 IPV6_ROUTER_GW_IP=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" port-list -c fixed_ips | grep $ipv6_pub_subnet_id | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' ')
353 die_if_not_set $LINENO IPV6_ROUTER_GW_IP "Failure retrieving IPV6_ROUTER_GW_IP"
354
355 if is_neutron_ovs_base_plugin; then
356 local ext_gw_interface
357 ext_gw_interface=$(_neutron_get_ext_gw_interface)
358 local ipv6_cidr_len=${IPV6_PUBLIC_RANGE#*/}
359
360 # Configure interface for public bridge
361 sudo ip -6 addr add $ipv6_ext_gw_ip/$ipv6_cidr_len dev $ext_gw_interface
362 sudo ip -6 route replace $FIXED_RANGE_V6 via $IPV6_ROUTER_GW_IP dev $ext_gw_interface
363 fi
364 _neutron_set_router_id
365 fi
366}