Create network and subnet
Register a network and subnet. This information is used when deploying new virtual servers.
Use APIs described in the Neutron (networks) topic to register a network and subnet.
You need the following minimal information:
- VLAN ID (for the provider:segmentation_id field)
- Network name (you choose)
- CIDR
- Network type
- Physical network
- Example
-
POST /v2.0/networks headers=
{ 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '01f7499e876945b99a26e8a115c063ad' } body= { "network": { "shared": false, "provider:segmentation_id": 1, "name": "mynetwork", "admin_state_up": true, "provider:network_type": "vlan", "provider:physical_network": "default" } } POST /v2.0/subnets headers= { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': '01f7499e876945b99a26e8a115c063ad' } body= { "subnet": { "enable_dhcp": false, "network_id": "7b343684-a1ab-4da1-ab19-9ae05a616381", "dns_nameservers": [ "1.2.3.253", "1.2.3.254" ], "allocation_pools": [ { "start": "1.2.3.1", "end": "1.2.3.254" } ], "gateway_ip": "1.2.3.1", "ip_version": 4, "cidr": "1.2.3.0/24" } }