gcloud beta compute instances network-interfaces update

NAME
gcloud beta compute instances network-interfaces update - update a Compute Engine virtual machine network interface
SYNOPSIS
gcloud beta compute instances network-interfaces updateINSTANCE_NAME[--aliases=ALIASES][--external-ipv6-address=EXTERNAL_IPV6_ADDRESS][--external-ipv6-prefix-length=EXTERNAL_IPV6_PREFIX_LENGTH][--igmp-query=IGMP_QUERY][--internal-ipv6-address=INTERNAL_IPV6_ADDRESS][--internal-ipv6-prefix-length=INTERNAL_IPV6_PREFIX_LENGTH][--ipv6-network-tier=IPV6_NETWORK_TIER][--network=NETWORK][--network-interface=NETWORK_INTERFACE; default="nic0"][--private-network-ip=PRIVATE_NETWORK_IP][--security-policy=SECURITY_POLICY][--security-policy-region=SECURITY_POLICY_REGION][--stack-type=STACK_TYPE][--subnetwork=SUBNETWORK][--zone=ZONE][GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA)gcloud beta compute instances network-interfacesupdate updates network interfaces of a Compute Engine virtual machine.For example:
gcloudbetacomputeinstancesnetwork-interfacesupdateexample-instance--zoneus-central1-a--aliasesr1:172.16.0.1/32

sets 172.16.0.1/32 from range r1 of the default interface's subnetwork as theinterface's alias IP.

POSITIONAL ARGUMENTS
INSTANCE_NAME
Name of the instance to operate on. For details on valid instance names, referto the criteria documented under the field 'name' at:https://cloud.google.com/compute/docs/reference/rest/v1/instances
FLAGS
--aliases=ALIASES
The IP alias ranges to allocate for this interface. If there are multiple IPalias ranges, they are separated by semicolons.

Can be specified together with --network and/or --subnetwork to choose IP aliasranges in the new subnetwork. If unspecified, then the previous IP alias rangeswill be allocated in the new subnetwork. If the previous IP alias ranges are notavailable in the new subnetwork, then other available IP alias ranges of thesame size will be allocated in the new subnetwork.

For example:

--aliases="10.128.1.0/24;r1:/32"
--external-ipv6-address=EXTERNAL_IPV6_ADDRESS
Assigns the given external IPv6 address to an instance. The address must be thefirst IP in the range. This option is not applicable to instances withstack-type=IPV4_ONLY.
--external-ipv6-prefix-length=EXTERNAL_IPV6_PREFIX_LENGTH
The prefix length of the external IPv6 address range. This flag should be usedtogether with--external-ipv6-address. Currently only/96 is supported and the default value is96.
--igmp-query=IGMP_QUERY
Determines if the Compute Engine instance can receive and respond to IGMP querypackets on the specified network interface.IGMP_QUERYmust be one of:
IGMP_QUERY_DISABLED
IGMP Query on the network interface is disabled.
IGMP_QUERY_V2
IGMP Query V2 on the network interface is enabled.
--internal-ipv6-address=INTERNAL_IPV6_ADDRESS
Assigns the given internal IPv6 address or range to an instance. The addressmust be the first IP address in the range or a /96 IP address range. This optioncan only be used on a dual stack instance network interface.
--internal-ipv6-prefix-length=INTERNAL_IPV6_PREFIX_LENGTH
Optional field that indicates the prefix length of the internal IPv6 addressrange, should be used together with--internal-ipv6-address=fd20::.Only /96 IP address range is supported and the default value is 96. If not set,then either the prefix length from--internal-ipv6-address=fd20::/96 will be used or the default valueof 96 will be assigned.
--ipv6-network-tier=IPV6_NETWORK_TIER
Specifies the IPv6 network tier that will be used to configure the instancenetwork interface IPv6 access config.IPV6_NETWORK_TIERmust be (only one value is supported):
PREMIUM
High quality, Google-grade network tier.
--network=NETWORK
Specifies the network this network interface belongs to.
--network-interface=NETWORK_INTERFACE; default="nic0"
The name of the network interface to update.
--private-network-ip=PRIVATE_NETWORK_IP
Assign the given IP address to the interface. Can be specified only togetherwith --network and/or --subnetwork to choose the IP address in the newsubnetwork. If unspecified, then the previous IP address will be allocated inthe new subnetwork. If the previous IP address is not available in the newsubnetwork, then another available IP address will be allocated automaticallyfrom the new subnetwork CIDR range.
--security-policy=SECURITY_POLICY
The security policy that will be set for this instance network interface. Toremove the policy from this instance network interface set the policy to anempty string.
--security-policy-region=SECURITY_POLICY_REGION
Region of the security policy to operate on. Overrides the defaultcompute/region property value for this command invocation.
--stack-type=STACK_TYPE
The stack type for the network interface. Determines if IPv6 is enabled on thenetwork interface.STACK_TYPE must be one of:
IPV4_IPV6
The network interface can have both IPv4 and IPv6 addresses.
IPV4_ONLY
The network interface will be assigned IPv4 addresses.
IPV6_ONLY
The network interface will be assigned IPv6 addresses.
--subnetwork=SUBNETWORK
Specifies the subnetwork this network interface belongs to.
--zone=ZONE
Zone of the instance to operate on. If not specified, you might be prompted toselect a zone (interactive mode only).gcloud attempts to identify theappropriate zone by searching for resources in your currently active project. Ifthe zone cannot be determined,gcloud prompts you for a selection withall available Google Cloud Platform zones.

To avoid prompting when this flag is omitted, the user can set thecompute/zone property:

gcloudconfigsetcompute/zoneZONE

A list of zones can be fetched by running:

gcloudcomputezoneslist

To unset the property, run:

gcloudconfigunsetcompute/zone

Alternatively, the zone can be stored in the environment variableCLOUDSDK_COMPUTE_ZONE.

GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudcomputeinstancesnetwork-interfacesupdate
gcloudalphacomputeinstancesnetwork-interfacesupdate

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-09-09 UTC.