Browse code

Generate an IPv6 address when PUBLIC_BRIDGE does not have one

Closes-Bug: #1400823
Change-Id: Ic79fd003aea2af7b258397ec2cdfd70c8568743c

Sean M. Collins authored on 2014/12/10 03:36:53
Showing 1 changed files
... ...
@@ -1177,6 +1177,12 @@ function _neutron_configure_router_v6 {
1177 1177
         # and then on to recover the public bridge's link local address
1178 1178
         sudo sysctl -w net.ipv6.conf.${PUBLIC_BRIDGE}.disable_ipv6=1
1179 1179
         sudo sysctl -w net.ipv6.conf.${PUBLIC_BRIDGE}.disable_ipv6=0
1180
+        if ! ip -6 addr show dev $PUBLIC_BRIDGE | grep 'scope global'; then
1181
+            # Create an IPv6 ULA address for PUBLIC_BRIDGE if one is not present
1182
+            IPV6_BRIDGE_ULA=`uuidgen | sed s/-//g | cut -c 23- | sed -e "s/\(..\)\(....\)\(....\)/\1:\2:\3/"`
1183
+            sudo ip -6 addr add fd$IPV6_BRIDGE_ULA::1 dev $PUBLIC_BRIDGE
1184
+        fi
1185
+
1180 1186
         if is_neutron_ovs_base_plugin && [[ "$Q_USE_NAMESPACE" = "True" ]]; then
1181 1187
             local ext_gw_interface=$(_neutron_get_ext_gw_interface)
1182 1188
             local ipv6_cidr_len=${IPV6_PUBLIC_RANGE#*/}