Subnets
A subnet is a set of globally routable IPv6 addresses and a range of IPv4 addresses within a Virtual Private Cloud (VPC). Subnets provide the IP addressing scheme for resources in your VPC, enabling VM-to-VM communication within the same network.
Default subnet configuration
Each default VPC in evroc has one subnet per availability zone. These subnets are created automatically and each is dynamically asigned a /64 globally routable IPv6 CIDR block, and has its own IPv4 address range:
| Zone | Subnet | CIDR (IPv4) | CIDR (example IPv6 - dynamically assigned) |
|---|---|---|---|
| se-sto-a | default-se-sto-a | 10.0.1.0/24 | 2a13:a0c4:110:8b02::/64 |
| se-sto-b | default-se-sto-b | 10.0.2.0/24 | 2a13:a0c4:110:8b03::/64 |
| se-sto-c | default-se-sto-c | 10.0.3.0/24 | 2a13:a0c4:110:8b01::/64 |
Each default subnet provides 252 usable private IPv4 addresses for VMs (4 addresses are reserved for the network address, default gateway, broadcast address, and one additional system address), and a /64 IPv6 CIDR block containing 2^64 (18.4 quintillion) addresses.
You can also create additional subnets in any VPC you have access to.
Stack types
Each subnet has a stack type that determines which IP protocols it supports:
- Dual-stack - Supports both IPv4 and IPv6 addresses
- IPv6-only - Supports only IPv6 addresses
The subnet's stack type is constrained by its parent VPC. A dual-stack VPC can contain dual-stack or IPv6-only subnets. An IPv6-only VPC can only contain IPv6-only subnets.
When you create a dual-stack subnet, you specify its IPv4 CIDR block and the service allocates a /64 IPv6 CIDR block automatically from the VPC's IPv6 range. IPv6-only subnets receive only the IPv6 CIDR block.
Zonal scope
Subnets are zonal resources—each subnet exists in a specific availability zone. When you create a VM, it is placed in a subnet based on the zone you specify.
VMs in different subnets (and therefore different zones) can still communicate with each other over the VPC's private network, subject to security group rules. The VPC spans all zones, providing connectivity across the entire region.
Subnet properties
Each subnet has the following characteristics:
- IP range: Customer-specified
/16to/29CIDR block for IPv4; service-allocated/64for IPv6 - Address type: Private IPv4 and/or IPv6
- Assignment: Automatic when creating VMs (can't be manually specified)
- Persistence: IP addresses remain associated with VMs for their lifetime
Subnet CIDR constraints
When you create a subnet, its IPv4 CIDR block must follow these rules:
- It must be within the parent VPC's IPv4 CIDR block
- It must not overlap with any other subnet in the same VPC
- The size can be between
/16and/29
Private vs public networking
Private IP addresses in the subnet are used for internal communication between VMs within the VPC. To enable inbound access from the public internet to a VM, you must attach a Public IP to that VM in addition to its private subnet address.
All VMs have a private IP from their zone's subnet. Public IPs are optional and are only required for inbound internet connectivity.
Next steps
- Learn about Regions and zones and how subnets relate to zones
- Learn about Virtual Private Clouds (VPCs) - the isolated network environment
- Understand the Default Networking Setup - what gets created automatically
- Learn how to manage Public IPs for internet access to your VMs
- Learn about IPv6 networking