how to create Neutron subnet

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

zero gravatar image

Hello,

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 10.101.0.0/24" 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=192.168.199.2,end=192.168.199.254 --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 192.168.101.0/24". After creating the subnet pool, I try to create subnet in that subnet pool using " openstack subnet create --allocation-pool start=192.168.101.2,end=192.168.101.254 --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
0

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

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=192.168.199.2,end=192.168.199.254 --network test1 --subnet-range 192.168.199.0/24 test_sub

allocation_pool must be an subset of the CIDR (i.e. 192.168.199.0/24).

edit flag offensive delete link more

Comments

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 -0600 )edit
0

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

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

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 779 times

Last updated: Nov 08 '17