Update a VPC subnet

Update a VPC Subnet. A successful request triggers a subnet_update event.

You can add, change, or remove a NAT Gateway for this subnet:

  • To add or change a NAT Gateway, specify its id. Outbound internet traffic for Linodes in the subnet will be routed through the designated gateway.
  • Interfaces with 1:1 NAT configured prefer to use 1:1 NAT on their primary VPC IP for egress traffic. Any additional VPC IPv4 addresses assigned to the interface will route outbound traffic through the NAT Gateway.
  • All active interfaces in the subnet consume one portset on the NAT Gateway, including those configured with 1:1 NAT. This ensures that removing 1:1 NAT later will not fail due to insufficient port space.
  • Portsets remain allocated to an interface even when its underlying compute node is powered off.
  • If the newly associated gateway does not have enough free portsets for every VPC interface on the subnet, it will attempt to autoscale (if enabled). If allocation still fails, the entire PUT request returns an error.
  • To detach a NAT Gateway, set natgateway to null. This action frees all active portset leases on the subnet, and Linodes that rely on the gateway for internet access will lose outbound connectivity.
  • The operation will be rejected if any existing Linodes in the target subnet use legacy configuration-style interfaces.

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: update_vpc_subnet
  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: vpc:read_write

CLI

linode-cli vpcs subnet-update $vpcId \
  --label vpc-subnet-temp \
  -- natgateway.id 43

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.

integer
required

The id of the VPC Subnet.

Body Params

A VPC Subnet Update request object.

string
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 (--).
integer

The unique identifier of the attached NAT Gateway instance.

Responses

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