Update the network interfaces for an instance
Every Compute Engine instance has a nic0
virtual network interface (vNIC)
connected to a subnet in a VPC network. Depending on the
instance's machine type, you can define additional vNICs only when you create a
instance.
With Dynamic Network Interfaces (Preview),
you can create VLAN-based subinterfaces for each vNIC, which lets
you scale the number of network interfaces and VPC
network connections.
You can add or remove Dynamic NICs without having to restart or
recreate the instance. For more information, see the following
pages in the Virtual Private Cloud (VPC) documentation:
This page describes how to update the properties of the network interface of an
instance.
Before you begin
Update a network interface of an instance
To update the properties of a network interface, see the procedure
that corresponds to the property that you want to update, such as one of
the following.
If you are updating a Dynamic NIC
(Preview), you must use the
gcloud beta compute instances network-interfaces update
command
or the beta version of the
instances.updateNetworkInterface
method.
Additionally, ensure that you specify Dynamic NICs according to
the naming format of Dynamic NICs.
What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[],[],null,["# Update the network interfaces for an instance\n\n*** ** * ** ***\n\nEvery Compute Engine instance has a `nic0` virtual network interface (vNIC)\nconnected to a subnet in a VPC network. Depending on the\ninstance's machine type, you can define additional vNICs only when you create a\ninstance.\n\nWith Dynamic Network Interfaces ([Preview](/products#product-launch-stages)),\nyou can create VLAN-based subinterfaces for each vNIC, which lets\nyou scale the number of network interfaces and VPC\nnetwork connections.\n\nYou can add or remove Dynamic NICs without having to restart or\nrecreate the instance. For more information, see the following\npages in the Virtual Private Cloud (VPC) documentation:\n\n- [Multiple network interfaces](/vpc/docs/multiple-interfaces-concepts)\n- [Add Dynamic NICs to an instance](/vpc/docs/add-dynamic-nics)\n- [Delete Dynamic NICs from an instance](/vpc/docs/delete-dynamic-nics)\n\nThis page describes how to update the properties of the network interface of an\ninstance.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nUpdate a network interface of an instance\n-----------------------------------------\n\nTo update the properties of a network interface, see the procedure\nthat corresponds to the property that you want to update, such as one of\nthe following.\n\nIf you are updating a Dynamic NIC\n([Preview](/products#product-launch-stages)), you must use the\n[`gcloud beta compute instances network-interfaces update` command](/sdk/gcloud/reference/beta/compute/instances/network-interfaces/update)\nor the beta version of the\n[`instances.updateNetworkInterface` method](/compute/docs/reference/rest/beta/instances/updateNetworkInterface).\nAdditionally, ensure that you specify Dynamic NICs according to\nthe [naming format of Dynamic NICs](/vpc/docs/multiple-interfaces-concepts#dynamic-nic-properties).\n\n- To update the network or subnetwork that the network interface belongs to, see [Migrating a VM between networks](/compute/docs/instances/migrating-interfaces-between-networks).\n- To update the IP stack type, see [Change the stack type of an instance](/compute/docs/ip-addresses/configure-ipv6-address#update-vm-stacktype).\n- To update IP addresses, see the following:\n - [Configure static internal IP addresses](/compute/docs/ip-addresses/configure-static-internal-ip-address)\n - [Configure static external IP addresses](/compute/docs/ip-addresses/configure-static-external-ip-address)\n- To update alias IP ranges, see [Modify alias IP ranges for an existing instance](/vpc/docs/configure-alias-ip-ranges#modifying_alias_ip_ranges_for_an_existing_instance).\n- To update network edge security policies, see [Configure network edge security policies](/armor/docs/network-edge-policies).\n\nWhat's next\n-----------\n\n- Learn how to [create and manage routes](/vpc/docs/using-routes) for VPC networks.\n- Learn how to scale your VMs and [optimize application latency with load balancing](/load-balancing/docs/tutorials/optimize-app-latency)."]]