put
https://api.linode.com//vpcs//subnets/
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
natgatewaytonull. 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
- Permissions:
-
OAuth scopes. Your user needs these scopes assigned. Learn more.
- Scopes:
vpc:read_write
- Scopes:
CLI
linode-cli vpcs subnet-update $vpcId \
--label vpc-subnet-temp \
-- natgateway.id 43