Update the network interfaces for an instance Stay organized with collections Save and categorize content based on your preferences.
Every Compute Engine instance has anic0 virtual network interface (vNIC)connected to a subnet in a VPC network. Depending on theinstance's machine type, you can define additional vNICs only when you create ainstance.
With Dynamic Network Interfaces,you can create VLAN-based subinterfaces for each vNIC, which letsyou scale the number of network interfaces and VPCnetwork connections.
You can add or remove Dynamic NICs without having to restart orrecreate the instance. For more information, see the followingpages in the Virtual Private Cloud (VPC) documentation:
This page describes how to update the properties of the network interface of aninstance.
Before you begin
- If you haven't already, set upauthentication. 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:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Update a network interface of an instance
To update the properties of a network interface, see the procedurethat corresponds to the property that you want to update, such as one ofthe following.
If you are updating a Dynamic NIC by using thegcloud CLI or the API, ensure that you specify theDynamic NIC according tothenaming format of Dynamic NICs.
- To update the network or subnetwork that the network interface belongs to,seeMigrating a VM between networks.
- To update the IP stack type, seeChange the stack type of an instance.
- To update IP addresses, see the following:
- To update alias IP ranges, seeModify alias IP ranges for an existing instance.
- To update network edge security policies, seeConfigure network edge security policies.
What's next
- Learn how tocreate and manage routes forVPC networks.
- Learn how to scale your VMs andoptimize application latency with load balancing.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.