Create a VPC subnet

Create a VPC subnet within an existing VPC. A successful request triggers a subnet_create event.

After you create a VPC subnet, you can attach it to a Linode by attaching the subnet to one of the Linode's network interfaces.

You can attach an existing NAT Gateway to the new subnet by specifying a NAT Gateway id.

  • If specified, outbound internet traffic from all attached Linodes within this subnet is automatically routed through the NAT Gateway.

  • Portsets remain allocated to an interface even when its Linode is shut down.

  • If a 1:1 NAT is explicitly assigned to a VPC interface in this subnet, traffic from that interface's primary VPC IP bypasses the NAT Gateway and routes through the 1:1 NAT instead.

Permissions and scopes

To call this operation, you need the following:

  • Identity and access permissions. Your user needs a role with these permissions assigned. Learn more.

    • Permissions: create_vpc_subnet
  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: vpc:read_write

CLI

linode-cli vpcs subnet-create $vpcId \
  --label cool-vpc-subnet \
  --ipv4 10.0.1.0/24 \
  --natgateway.id 42

Learn more

Path Params
string
enum
required

Enum Call either the v4 URL, or v4beta for operations still in Beta.

Allowed:
integer
required

The id of the VPC.

Body Params

VPC Subnet Create request object.

string
required

IPv4 range in CIDR canonical form.

  • The range must belong to a private address space as defined in RFC1918.
  • Allowed prefix lengths: 1-29.
  • The range must not overlap with 192.168.128.0/17.
  • The range must not overlap with other subnets on the same VPC.
string
required
length between 1 and 64

Filterable The VPC subnet's label, for display purposes only.

  • Must be unique among the VPC's subnets.
  • Can only contain ASCII letters, numbers, and dashes (-). You can't use two consecutive dashes (--).
natgateway
object | null

Beta Information about the NAT Gateway attached to this interface's subnet. This field returns null if no NAT Gateway is attached to the subnet.

Responses

Language
Credentials
LoadingLoading…
Response
Choose an example:
application/json