Creates an interface for a Linode. Unlike legacy interfaces attached to configuration profiles, this interface links directly to the Linode itself. You can create, update, or delete these interfaces only when the Linode is powered off or during its initial creation.
Firewalls are applied to the Linode's VPC or public interface, rather than directly on the Linode. You can add, delete, or update these firewalls at any time. Firewalls are not applied to VLAN interfaces.
A successful request triggers an interface_create event.
You need to set one interface type: vpc, public, or vlan. Omit the others or set them to null.
A Linode can have up to three interfaces:
-
Only one
publicinterface is allowed on a Linode. -
Multiple
vlaninterfaces are allowed, provided that they belong to distinct VLANs, which have uniquevlan_labels. -
One
vpcinterface is allowed.
If you create a VPC interface within a subnet that has an active NAT Gateway, the system automatically allocates one outbound portset to this interface. If no portsets are free and the gateway has autoscaling enabled, the system automatically attempts to scale up and provision a new public IP for the gateway.
Configuration profile VPC interfaces can't be used on subnets with an active NAT Gateway.
The Linode must be located in a region that supports Linode interfaces. Run Get a region to see if interfaces are supported in that region.
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_linode
- Permissions:
-
OAuth scopes. Your user needs these scopes assigned. Learn more.
- Scopes:
linodes:read_write
- Scopes:
CLI
Public interface
linode-cli linodes interface-add $linodeId \
--firewall_id 123 \
--default_route.ipv4 true \
--default_route.ipv6 true \
--public.ipv4.addresses '[{"address": "192.0.2.141", "primary": true}, {"address": "auto", "primary": false}]' \
--public.ipv6.ranges '[{"range": "2001:0db8::1/64"}, {"range": "/64"}]'VLAN interface
linode-cli linodes interface-add $linodeId \
--vlan.vlan_label my-vlan \
--vlan.ipam_address 192.168.2.2/24VPC interface
linode-cli linodes interface-add $linodeId \
--firewall_id 123 \
--default_route.ipv4 true \
--vpc.subnet_id 321 \
--vpc.ipv4.addresses '[{"address": "10.0.0.1", "primary": true, "nat_1_1_address": "auto"}, {"address": "auto", "primary": false, "nat_1_1_address": null}]' \
--vpc.ipv4.ranges '[{"range": "/28"}, {"range": "10.11.12.0/24"}]'