Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Setiap instance Compute Engine memiliki nic0antarmuka jaringan virtual (vNIC)
yang terhubung ke subnet dalam jaringan VPC. Bergantung pada jenis mesin instance, Anda hanya dapat menentukan vNIC tambahan saat membuat instance.
Dengan Antarmuka Jaringan Dinamis (Pratinjau),
Anda dapat membuat subantarmuka berbasis VLAN untuk setiap vNIC, yang memungkinkan
Anda menskalakan jumlah antarmuka jaringan dan koneksi
jaringan VPC.
Anda dapat menambahkan atau menghapus NIC Dinamis tanpa harus memulai ulang atau
membuat ulang instance. Untuk mengetahui informasi selengkapnya, lihat halaman berikut dalam dokumentasi Virtual Private Cloud (VPC):
Halaman ini menjelaskan cara memperbarui properti antarmuka jaringan instance.
Sebelum memulai
Siapkan autentikasi, jika Anda belum melakukannya.
Autentikasi memverifikasi identitas Anda untuk mengakses Google Cloud layanan dan API. Untuk menjalankan
kode atau sampel dari lingkungan pengembangan lokal, Anda dapat melakukan autentikasi ke
Compute Engine dengan memilih salah satu opsi berikut:
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
Menginstal Google Cloud CLI.
Setelah penginstalan,
lakukan inisialisasi Google Cloud CLI dengan menjalankan perintah berikut:
Untuk memperbarui properti antarmuka jaringan, lihat prosedur
yang sesuai dengan properti yang ingin Anda perbarui, seperti salah satu
prosedur berikut.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 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)."]]