Ask Your Question

how to create Neutron subnet

asked 2017-11-08 00:10:20 -0500

zero gravatar image


I am trying to use openstackclient and neutron client create a Neutron network with specific subnet, but the command line returns exceptions. here is my situation:

I use "neutron subnet-create test1" command line, the subnet can be created easily. but it is "neutron CLI is deprecated and will be removed in the future." , then I use "openstack subnet create --allocation-pool start=,end= --network test1 test_sub". It tells me " Bad subnets request: a subnetpool must be specified in the absence of a cidr.".

Therefore I create a subnet pool "openstack subnet pool create test_pool --pool-prefix". After creating the subnet pool, I try to create subnet in that subnet pool using " openstack subnet create --allocation-pool start=,end= --network test1 --subnet-pool 92fdc03d-2595-46bf-951b-03583f637bb6 test_sub". I got this response: Bad subnets request: allocation_pools allowed only for specific subnet requests..

My question: 1. is there something wrong with my operations? 2. what is the relationship between allocation_pools and subnet? 3. why to use such complicated way to create a subnet?

Hope you would answer my question, thanks in advance.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-11-08 01:53:02 -0500

mlschuler gravatar image

Subnet pools are an advanced feature. What you need is a CIDR - not a subnet pool. Try the following:

openstack subnet create --allocation-pool start=,end= --network test1 --subnet-range test_sub

allocation_pool must be an subset of the CIDR (i.e.

edit flag offensive delete link more


thank you for your timely response, but this response "Bad subnets request: a subnetpool must be specified in the absence of a cidr." indicates it also possible to create a subnet without cidr, but with subnetpool, so how can I create a subnet with subnetpool, could you show me a example ?

zero gravatar imagezero ( 2017-11-08 03:49:34 -0500 )edit

answered 2017-11-08 07:09:20 -0500

I don't think you can provide the allocation-pool parameter together with subnet-pool. The idea of subnet pools is relieving you of the need to track addresses you allocate.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-11-08 00:10:20 -0500

Seen: 622 times

Last updated: Nov 08 '17