gcloud beta compute instances network-interfaces add Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta compute instances network-interfaces add - add a Dynamic Network Interface to a Compute Engine instance
- SYNOPSIS
gcloud beta compute instances network-interfaces addINSTANCE_NAME[--aliases=ALIASES][--external-ipv6-address=EXTERNAL_IPV6_ADDRESS][--external-ipv6-prefix-length=EXTERNAL_IPV6_PREFIX_LENGTH][--internal-ipv6-address=INTERNAL_IPV6_ADDRESS][--internal-ipv6-prefix-length=INTERNAL_IPV6_PREFIX_LENGTH][--ipv6-network-tier=IPV6_NETWORK_TIER][--network=NETWORK][--network-attachment=NETWORK_ATTACHMENT][--network-tier=NETWORK_TIER][--parent-nic-name=PARENT_NIC_NAME][--private-network-ip=PRIVATE_NETWORK_IP][--stack-type=STACK_TYPE][--subnetwork=SUBNETWORK][--vlan=VLAN][--zone=ZONE][--address=ADDRESS|--no-address][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)gcloud beta compute instances network-interfacesaddadds a Dynamic Network Interface to a Compute Engine instance.- EXAMPLES
- To add a Dynamic Network Interface to a Compute Engine instance, run:
gcloudbetacomputeinstancesnetwork-interfacesaddinstance-name--parent-nic-name=nic1--vlan=2--network=network-1--subnetwork=subnetwork-1 - 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.
For example:
--aliases="10.128.1.0/24;range1:/32"
Each IP alias range consists of a range name and an IP range separated by acolon, or just the IP range. The range name is the name of the range within thenetwork interface's subnet from which to allocate an IP alias range. Ifunspecified, it defaults to the primary IP range of the subnet. The IP range canbe a CIDR range (e.g.
192.168.100.0/24), a single IP address (e.g.192.168.100.1), or a netmask in CIDR format (e.g./24). If the IP range is specified by CIDR range or single IPaddress, it must belong to the CIDR range specified by the range name on thesubnet. If the IP range is specified by netmask, the IP allocator will pick anavailable range with the specified netmask and allocate it to this networkinterface. --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/96is supported and the default value is96. --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::/96will 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-attachment=NETWORK_ATTACHMENT- The network attachment URL this network interface should connect to.
--network-tier=NETWORK_TIER- Specifies the network tier that will be used to configure the instance networkinterface.
must be one of:NETWORK_TIERPREMIUM,STANDARD,FIXED_STANDARD. Thedefault value isPREMIUM.NETWORK_TIERmustbe one of:FIXED_STANDARD- Public internet quality with fixed bandwidth.
PREMIUM- High quality, Google-grade network tier.
STANDARD- Public internet quality.
--parent-nic-name=PARENT_NIC_NAME- Name of the parent network interface of a dynamic network interface.
--private-network-ip=PRIVATE_NETWORK_IP- Specifies the RFC1918 IP to assign to the network interface. The IP should be inthe subnet IP range.
--stack-type=STACK_TYPE- The stack type for the network interface. Determines if IPv6 is enabled on thenetwork interface.
STACK_TYPEmust 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.
--vlan=VLAN- VLAN tag of a dynamic network interface, must be an integer in the range from 2to 255 inclusively.
--zone=ZONE- Zone of the instance to operate on. If not specified, you might be prompted toselect a zone (interactive mode only).
gcloudattempts to identify theappropriate zone by searching for resources in your currently active project. Ifthe zone cannot be determined,gcloudprompts you for a selection withall available Google Cloud Platform zones.To avoid prompting when this flag is omitted, the user can set the
property:compute/zonegcloudconfigsetcompute/zoneZONEA list of zones can be fetched by running:
gcloudcomputezoneslistTo unset the property, run:
gcloudconfigunsetcompute/zoneAlternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE - At most one of these can be specified:
--address=ADDRESS- Assigns the given external address to the network interface. The address mightbe an IP address or the name or URI of an address resource. Specifying an emptystring will assign an ephemeral IP. Mutually exclusive with no-address. Ifneither key is present the network interface will get an ephemeral IP.
--no-address- If specified the network interface will have no external IP. Mutually exclusivewith address. If neither key is present the network interfaces will get anephemeral IP.
- 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 helpfor details. - NOTES
- This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudcomputeinstancesnetwork-interfacesaddgcloudalphacomputeinstancesnetwork-interfacesadd
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-30 UTC.