You are here: Supporting Documents > Reference Topics > Concepts > Subnet Reference

Subnet Reference

A subnet represents an IP address block that can be used to assign IP addresses to virtual instances. Each subnet must have a Classless Inter-Domain Routing (CIDR) address, and must be associated with a network. IPs can be either selected from the whole subnet CIDR address, or from allocation pools specified by the user.

A subnet can optionally have a gateway, a list of DNS name servers, and host routes. This information is pushed to instances whose interfaces are associated with the subnet.

 
Attribute Type Required CRUD[a] Default Value Validation Constraints Notes
id uuid-str N/A R generated N/A UUID representing the subnet.
network_id uuid-str Yes CR N/A Network with which this subnet is associated. N/A
name String No CRU None N/A Human-readable name for the subnet; may not be unique.
ip_version int Yes CR 4 { 4 | 6 } IP version.
cidr string Yes CR N/A Valid CIDR in the form <network_address>/<prefix> CIDR representing the IP range for this subnet, based on IP version.
gateway_ip string No CRUD first address in cidr Valid IP address or null. Default gateway used by devices in this subnet .
dns_nameservers list(str) No CRU Empty list No constraint. DNS name servers used by hosts in this subnet.
allocation_pools list(dict) No CR Every address in cidr, excluding gateway_ip if configured Start/end of range must be a valid IP. Sub-ranges of CIDR available for dynamic allocation to ports [ { "start": "10.0.0.2", "end": "10.0.0.254"} ].
host_routes list(dict) No CRU Empty List [] Routes that should be used by devices with IPs from this subnet, not including local subnet route.
enable_dhcp Bool No CRU True { True | False } Specifies whether DHCP is enabled for this subnet.
tenant_id uuid-str No[b] CR N/A No constraint. Owner of network. Only admin users can specify a tenant_id other than its own.

[a]

  • C. Use the attribute in create operations.

  • R. This attribute is returned in response to show and list operations.

  • U. You can update the value of this attribute.

  • D. You can delete the value of this attribute.

     

[b] If OpenStack networking is not running with the Keystone identity service, the tenant_id attribute is required.

of