def _add_interface_by_subnet(self, context, router, subnet_id, owner):
subnet = self._core_plugin._get_subnet(context, subnet_id)
- if not subnet['gateway_ip']:
+ if (not subnet['gateway_ip']
+ and not ipv6_utils.is_slaac_subnet(subnet)):
msg = _('Subnet for router interface must have a gateway IP')
raise n_exc.BadRequest(resource='router', msg=msg)
+ if (subnet['ip_version'] == 6 and subnet['ipv6_ra_mode'] is None
+ and subnet['ipv6_address_mode'] is not None):
+ msg = (_('IPv6 subnet %s configured to receive RAs from an '
+ 'external router cannot be added to Neutron Router.') %
+ subnet['id'])
+ raise n_exc.BadRequest(resource='router', msg=msg)
self._check_for_dup_router_subnet(context, router,
subnet['network_id'],
subnet_id,