In a lab environment in the university I only had access to a list of fragmented public routable IP addresses in a single subnet. For example I got access to the following ips,, But I am not allowed to use and

Update: The Openstack neutron API supports fragmented floating ips but not through the CLI. You have to use the Python API like below:

import logging
from neutronclient.neutron import client

auth_url = ""

neutron = client.Client('2.0', username="admin", password="password", tenant_name="demo", auth_url=auth_url)

print "".join(neutron.list_subnets())

req = {"subnet": {"allocation_pools": [{"start": "", "end": ""}, {"start": "", "end": ""}, {"start": "", "end": ""}]}}

neutron.update_subnet("d5d48930-7bfb-4f0c-8968-13f8af785868", req)

Old hacky way:

It seems that currently the only way to solve this is to manually change the database bypassing the API. I used the following SQL insert statements to solve my problem. This is assuming that is already part of the pool.

use neutron;
select * from ipallocationpools;
| id                                   | subnet_id                            | first_ip       | last_ip         |
| 78857059-658b-4027-909d-7b8c6d62e52f | c58d4e69-d614-4d05-91e5-95b5cc48b670 |    |     |
| c2931835-050b-40a0-bfc6-6dcb833517f6 | eda970d4-21c0-4488-85b2-0d3d0000ebb9 |  | |

insert into ipallocationpools VALUES (UUID(), "c58d4e69-d614-4d05-91e5-95b5cc48b670", 
                                      "", ""); 
insert into ipallocationpools VALUES (UUID(), "c58d4e69-d614-4d05-91e5-95b5cc48b670", 
                                      "", "");

After inserting the ips, the floating ips can be allocated automatically using horizon and be successfuly assigned to instances. But please note that this is not officially supported and hacky! I haven't seen any problems as of now, but there probably are some problems with this approach. I just used it for testing.

Side note

Previously in nova-network you could easily add single floating ips or smaller ranges within a subnet. But with neutron the CLI and API's seems to not support this. So after looking at the code I noticed that the data model in fact supports multiple allocation pools for a single subnet:

class IPAllocationPool(model_base.BASEV2, HasId):
    """Representation of an allocation pool in a Neutron subnet."""

    subnet_id = sa.Column(sa.String(36), sa.ForeignKey('',
    first_ip = sa.Column(sa.String(64), nullable=False)
    last_ip = sa.Column(sa.String(64), nullable=False)
    available_ranges = orm.relationship(IPAvailabilityRange,
                                        cascade='all, delete-orphan')

class Subnet(model_base.BASEV2, HasId, HasTenant):
    """Represents a neutron subnet.

    When a subnet is created the first and last entries will be created. These
    are used for the IP allocation.

    name = sa.Column(sa.String(255))
    network_id = sa.Column(sa.String(36), sa.ForeignKey(''))
    ip_version = sa.Column(sa.Integer, nullable=False)
    cidr = sa.Column(sa.String(64), nullable=False)
    gateway_ip = sa.Column(sa.String(64))
    allocation_pools = orm.relationship(IPAllocationPool,


comments powered by Disqus