Skip to main content

Overview

Subnets define the IP address space within a network. Each subnet specifies a CIDR block, optional DHCP assignment, a gateway IP, and DNS resolvers that are pushed to instances at boot. A single network can host multiple subnets — e.g., one IPv4 and one IPv6 range — or separate subnets for different application tiers.
Prerequisites
  • An existing Xloud tenant network (see Create a Network)
  • Dashboard access or CLI configured with valid credentials

Add a Subnet to an Existing Network

Open the network

Navigate to Project → Network → Networks and click the network name to open it.

Add a subnet

Click the Subnets tab, then click Create Subnet.

Configure CIDR and gateway

FieldDescription
Subnet NameDescriptive name, e.g., db-subnet
Network AddressCIDR block, e.g., 10.0.2.0/24
IP VersionIPv4 or IPv6
Gateway IPOptional — leave blank for auto-assign or enter 0.0.0.0 to disable

Configure DHCP and allocation options

OptionDescription
Enable DHCPProvide automatic IP assignment for instances on this subnet
Allocation PoolsRestrict the DHCP-assigned range, e.g., 10.0.2.10,10.0.2.200
DNS Name ServersComma-separated list of resolvers
Host RoutesStatic routes injected via DHCP in destination,nexthop format
Use allocation pools to reserve address ranges for manually configured hosts such as database nodes or network appliances with static IPs.

Create the subnet

Click Create to save the subnet.
The subnet appears in the network’s Subnets tab with status Active.

Subnet Management Operations

Update DNS Resolvers

Navigate to Project → Network → Networks, open the subnet row, and click Edit Subnet. Update the DNS Name Servers field in the Subnet Details section.

Add Host Routes

Host routes are injected via DHCP and add static routing entries on the guest OS. Use them to direct traffic for specific CIDRs through a dedicated gateway.
Add host route to subnet
openstack subnet set app-subnet \
  --host-route destination=172.16.0.0/12,gateway=192.168.10.254

Disable or Enable DHCP

Disable DHCP on a subnet
openstack subnet set app-subnet --no-dhcp
Re-enable DHCP on a subnet
openstack subnet set app-subnet --dhcp
Disabling DHCP on a subnet that has instances running will cause those instances to fail IP renewal on the next lease expiry. Ensure all instances on the subnet are configured with static IPs before disabling DHCP.

Subnet Configuration Reference

ParameterCLI FlagDescription
CIDR--subnet-rangeIP address range in CIDR notation
Gateway--gatewayDefault gateway IP for DHCP clients
DHCP--dhcp / --no-dhcpEnable or disable automatic IP assignment
Allocation Pool--allocation-poolStart/end range for DHCP-assigned addresses
DNS Servers--dns-nameserverResolvers pushed to instances (repeat for multiple)
Host Routes--host-routeStatic routes injected via DHCP
IP Version--ip-version4 for IPv4, 6 for IPv6

Next Steps

Routers and Gateways

Attach subnets to a router to enable inter-subnet routing and internet access

DNS Configuration

Configure DNS name servers and hostname resolution for your subnets

Create a Network

Create the network that hosts your subnets

Network Troubleshooting

Diagnose and resolve subnet connectivity and DHCP issues