# Extending external subnet (change CIDR)?

Hello, When creating our OpenStack environment a year or so ago, we mistakenly allocated only a 24-bit subnet (10.35.204.0/24) for external floating IP addresses. I'd now like to extend it to 10.35.204.0/23. We're using Kilo, running on Centos 7.1

neutron subnet-list shows this:

| id                                   | name                | cidr                     | allocation_pools
| 70457db9-c28c-4e05-baa9-ed6b9f1f2d74 | ext-subnet          | 10.35.204.0/24           | {"start": "10.35.204.10", "end": "10.35.204.254"}


Can I use the following?

neutron subnet-update ext-subnet --allocation-pool start=10.35.204.10,end=10.35.205.254 --gateway 10.35.204.1 10.35.204.0/23


I'm not sure about it because the update-subnet command help doesn't mention allowing a CIDR argument, like the subnet-create command does. Ideally I'd like to avoid deleting the subnet and recreating it with the new CIDR because I imagine that will break all the existing floating address associations in place - but maybe I'm wrong about that. It would be brilliant if somebody could confirm it for me or give any advice for how best to achieve my goal.

edit retag close merge delete

Sort by » oldest newest most voted

Hi, I've had to do a similar thing in my Liberty installation, so I don't know if this can be applied to Kilo too. I haven't found any command to change the CIDR of a network, so I edited manually on the database (neutron db, on the table subnets, column cidr) and then changed the allocation pool on the table ipallocationpools. Finally, restart the l3 agent service on every node it is active.

I know that working directly on the DB is not a best-practice, but that was the only way I found to achieve network expansion.

more

1

There's a good step-by-step guide to achieving this here: https://cloudblog.switch.ch/2015/09/2... - not that I have tried it; caution is very much advised!!

( 2016-09-04 16:38:29 -0600 )edit

hi,

We had a similar issue on our MOS 7.0 installation. Also created the cloud with to small of range for floating IPs, and from what i understand you cannot add another external network in MOS Fuel.

This is kinda of a hack but it worked. On your external network, you can add another subnet range. i.e 1 external network, but with 2 subnet ranges. For this to work you have to configure a secondary IP/GW on your external switch. i.e. the vlan on external switch have 2 GW IPs configured. 10.0.1.1 and 10.0.2.1

The result is 2x /24 instead of 1x /23 so you loose a few IPs on it, but we found no other way to get it done :(

root@node-26:~# neutron net-show net04_ext -f shell | grep subnets

subnets="528702cb-11ca-4ec2-87e8-d2785415f7f9
7e906c00-c75f-406a-9c63-ecfc7bdf9f3e"

root@node-26:~# neutron subnet-show 528702cb-11ca-4ec2-87e8-d2785415f7f9 -f shell

allocation_pools="{\"start\": \"10.0.1.2\", \"end\": \"10.0.1.254\"}

cidr="10.0.1.0/24"

gateway_ip="10.0.1.1"

name="net04_ext__subnet"

root@node-26:~# neutron subnet-show 7e906c00-c75f-406a-9c63-ecfc7bdf9f3e -f shell

allocation_pools="{\"start\": \"10.0.2.2\", \"end\": \"10.0.2.254\"}"

cidr="10.0.2.0/24"

gateway_ip="10.0.2.1"

name="net04_ext__subnet2"

more

# Get to know Ask OpenStack

Resources for moderators