Expand description
Creates a subnet on a network.
OpenStack Networking does not try to derive the correct IP version from the
CIDR. If you do not specify the gateway_ip attribute, OpenStack
Networking allocates an address from the CIDR for the gateway for the
subnet.
To specify a subnet without a gateway, set the gateway_ip attribute to
null in the request body. If you do not specify the allocation_pools
attribute, OpenStack Networking automatically allocates pools for covering
all IP addresses in the CIDR, excluding the address reserved for the subnet
gateway. Otherwise, you can explicitly specify allocation pools as shown in
the following example.
When you specify both the allocation_pools and gateway_ip attributes,
you must ensure that the gateway IP does not overlap with the allocation
pools; otherwise, the call returns the Conflict (409) response code.
A subnet can have one or more name servers and host routes. Hosts in this subnet use the name servers. Devices with IP addresses from this subnet, not including the local subnet route, use the host routes.
Specify the ipv6_ra_mode and ipv6_address_mode attributes to create
subnets that support IPv6 configurations, such as stateless address
autoconfiguration (SLAAC), DHCPv6 stateful, and DHCPv6 stateless
configurations.
A subnet can optionally be associated with a network segment when it is
created by specifying the segment_id of a valid segment on the specified
network. A network with subnets associated in this way is called a routed
network. On any given network, all of the subnets must be associated with
segments or none of them can be. Neutron enforces this invariant.
Currently, routed networks are only supported for provider networks.
Normal response codes: 201
Error response codes: 400, 401, 403, 404, 409
Structs§
- Allocation
Pools - Allocation
Pools Builder - Builder for
AllocationPools. - Host
Routes - Host
Routes Builder - Builder for
HostRoutes. - Request
- Request
Builder - Builder for
Request. - Subnet
- A
subnetobject. - Subnet
Builder - Builder for
Subnet.
Enums§
- Allocation
Pools Builder Error - Error type for AllocationPoolsBuilder
- Host
Routes Builder Error - Error type for HostRoutesBuilder
- Ipv6
Address Mode - Ipv6
RaMode - Request
Builder Error - Error type for RequestBuilder
- Subnet
Builder Error - Error type for SubnetBuilder