Manage VPC subnets

A VPC contains one or more subnets, which are networks within the VPC whose services all share the same IPv4 CIDR range. Just like VPCs, subnets are restricted to a single data center. Multiple subnets can be added to isolate services that are used for certain functionality of an application (like front-end and back-end services) or can segment a VPC and its attached services into different environments (such as development, staging, and production).

Subnet components

  • Subnet Label: An alphanumeric string (containing only letters, numbers, and hyphens) used to identify the subnet. It should be unique among other subnets in the same VPC and should provide an indication as to its intended usage.

  • Subnet IP Address Range: VPC subnet ranges must be in the RFC1918 IPv4 address space designated for private networks. That said, it cannot overlap with the 192.168.128.0/17 range set aside for Private IP addresses on Linodes.

  • NAT Gateway (Optional): A subnet can be attached to a NAT Gateway to provide shared outbound-only internet connectivity for all Linodes assigned to that subnet while blocking unsolicited inbound connections.

  • Assigned Services: Each subnet can have multiple services assigned to it. These services can communicate with other services in any subnet in the same VPC.

Considerations

  • Up to 10 subnets can be created on a VPC.
  • A subnet is located within a single data center.
  • Each subnet can have at most one IPv4 CIDR block. Review Valid IPv4 ranges.
  • Each service assigned to a subnet must have a unique IPv4 address in the defined range.

Valid IPv4 ranges for a subnet

When defining an IPv4 range for a subnet, use a CIDR block within the RFC1918 specification that can accommodate the number of Linodes you anticipate being assigned to the subnet. Your subnet must be within the following blocks:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16 (excluding 192.168.128.0/17 which is reserved for the private IP address feature)

View subnets

  1. View the VPCs page in Cloud Manager. See View VPCs.

  2. Locate and click the name of the VPC you wish to inspect. This displays the details page for that VPC.

  3. Review the Subnets section to view all of the subnets on the VPC.

Each subnet is listed alongside its defined CIDR block, assigned NAT Gateway (if attached), and the number of services assigned. Click the NAT Gateway label to navigate directly to its details page. Subnets can be expanded to view all resources assigned to that particular subnet, along with their assigned IPs and applied Cloud Firewalls.

Add a subnet

Up to 10 subnets can be added to each VPC.

  1. Navigate to the Subnets section of a VPC. See View subnets.

  2. Click the Create Subnet button. This opens the Create Subnet panel.

  3. Complete the following fields in the form:

    • Subnet Label: Enter a unique label for the subnet.
    • Subnet IP Address Range: Enter an available RFC1918 IPv4 CIDR range (for example, 10.0.1.0/24).
    • NAT Gateway (Optional): Select an existing NAT Gateway from the dropdown menu to route outbound internet traffic for Linodes in this subnet.
  4. Click the Create Subnet button.

Edit a subnet's label or NAT Gateway

Once a subnet has been created, its label can be updated and its NAT Gateway association can be changed or removed. You can't modify the CIDR block.

  1. Navigate to the Subnets section of a VPC. See View subnets.

  2. Locate the subnet you wish to edit, expand the corresponding ellipsis menu, and click the Edit option. This opens the Edit Subnet panel.

  3. Modify the label and click Save.

Assign a service to a subnet

Review the Assign a Linode to a VPC guide.

Remove a Linode or NAT Gateway from a subnet

You can unassign both Linodes and NAT Gateways from a VPC subnet directly from the subnet row. A Linode must be powered off before it can be removed from a subnet, whereas a NAT Gateway can be unassigned immediately.

Remove a Linode from a subnet

  1. Navigate to the Subnets section of a VPC. See View subnets.

  2. Locate and expand the subnet that the service belongs to.

  3. Within the list of assigned services, locate the Linode you wish to remove.

  4. If the Linode is not already powered off, click the corresponding Power Off.

  5. Once the Linode is fully powered off, click the corresponding Unassign Linode.

Once the Linode has been removed, you can power it back on or delete it. If you plan to continue using it, review the Configuration Profile interfaces (in the Configurations tab) or Linode interfaces (in the Network tab) to ensure proper operation.

Remove a NAT Gateway from a subnet

  1. Navigate to the Subnets section of a VPC. See View subnets.
  2. Locate the subnet attached to the NAT Gateway you want to remove.
  3. Click the action menu (...) at the far right of the subnet row.
  4. Select Unassign NAT Gateway.
  5. Confirm the action in the prompt.
⚠️

Unassigning a NAT Gateway takes effect immediately and drops all active outbound external network connections for running Linodes in that subnet.


Did this page help you?