HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_compute_networks_subnets_update.1
.TH "GCLOUD_ALPHA_COMPUTE_NETWORKS_SUBNETS_UPDATE" 1



.SH "NAME"
.HP
gcloud alpha compute networks subnets update \- updates properties of an existing Compute Engine subnetwork



.SH "SYNOPSIS"
.HP
\f5gcloud alpha compute networks subnets update\fR \fINAME\fR [\fB\-\-add\-secondary\-ranges\-with\-reserved\-internal\-range\fR=\fIRANGE_NAME\fR=\fIINTERNAL_RANGE_URL\fR,[...]] [\fB\-\-aggregation\-interval\fR=\fIAGGREGATION_INTERVAL\fR] [\fB\-\-drain\-timeout\fR=\fIDRAIN_TIMEOUT\fR;\ default="0s"] [\fB\-\-external\-ipv6\-prefix\fR=\fIEXTERNAL_IPV6_PREFIX\fR] [\fB\-\-flow\-sampling\fR=\fIFLOW_SAMPLING\fR] [\fB\-\-internal\-ipv6\-prefix\fR=\fIINTERNAL_IPV6_PREFIX\fR] [\fB\-\-ip\-collection\fR=\fIIP_COLLECTION\fR] [\fB\-\-ipv6\-access\-type\fR=\fIIPV6_ACCESS_TYPE\fR] [\fB\-\-logging\-aggregation\-interval\fR=\fILOGGING_AGGREGATION_INTERVAL\fR] [\fB\-\-logging\-filter\-expr\fR=\fILOGGING_FILTER_EXPR\fR] [\fB\-\-logging\-flow\-sampling\fR=\fILOGGING_FLOW_SAMPLING\fR] [\fB\-\-logging\-metadata\fR=\fILOGGING_METADATA\fR] [\fB\-\-logging\-metadata\-fields\fR=[\fIMETADATA_FIELD\fR,...]] [\fB\-\-metadata\fR=\fIMETADATA\fR] [\fB\-\-region\fR=\fIREGION\fR] [\fB\-\-stack\-type\fR=\fISTACK_TYPE\fR] [\fB\-\-add\-secondary\-ranges\fR=\fIPROPERTY\fR=\fIVALUE\fR,[...]\ |\ \fB\-\-[no\-]allow\-cidr\-routes\-overlap\fR\ |\ \fB\-\-[no\-]enable\-flow\-logs\fR\ |\ \fB\-\-[no\-]enable\-private\-ip\-google\-access\fR\ |\ \fB\-\-private\-ipv6\-google\-access\-type\fR=\fIPRIVATE_IPV6_GOOGLE_ACCESS_TYPE\fR\ |\ \fB\-\-purpose\fR=\fIPURPOSE\fR\ |\ \fB\-\-remove\-secondary\-ranges\fR=\fIPROPERTY\fR=\fIVALUE\fR,[...]\ |\ \fB\-\-role\fR=\fIROLE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR \fBgcloud alpha compute networks subnets update\fR is used to
update properties of an existing Compute Engine subnetwork.



.SH "EXAMPLES"

To enable external IPv6 addresses on the subnetwork example\-subnet\-1 in
network\-1, run

.RS 2m
$ gcloud alpha compute networks subnets update example\-subnet\-1 \e
    \-\-stack\-type=IPV4_IPV6 \-\-ipv6\-access\-type=EXTERNAL \e
    \-\-region=REGION
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
\fINAME\fR

Name of the subnetwork to update.


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-add\-secondary\-ranges\-with\-reserved\-internal\-range\fR=\fIRANGE_NAME\fR=\fIINTERNAL_RANGE_URL\fR,[...]

Adds secondary IP ranges that are associated with internal range resources.

For example, \f5\-\-add\-secondary\-ranges\-with\-reserved\-internal\-range
range1=//networkconnectivity.googleapis.com/projects/PROJECT/locations/global/internalRanges/RANGE\fR
adds a secondary range with the reserved internal range resource.

.RS 2m
.IP "\(em" 2m
\f5RANGE_NAME\fR \- Name of the secondary range.
.IP "\(em" 2m
\f5INTERNAL_RANGE_URL\fR \- \f5URL of an internal range resource.\fR
.RE
.sp

.TP 2m
\fB\-\-aggregation\-interval\fR=\fIAGGREGATION_INTERVAL\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled. Toggles
the aggregation interval for collecting flow logs. Increasing the interval time
will reduce the amount of generated flow logs for long lasting connections.
Default is an interval of 5 seconds per connection. \fIAGGREGATION_INTERVAL\fR
must be one of: \fBinterval\-10\-min\fR, \fBinterval\-15\-min\fR,
\fBinterval\-1\-min\fR, \fBinterval\-30\-sec\fR, \fBinterval\-5\-min\fR,
\fBinterval\-5\-sec\fR.

.TP 2m
\fB\-\-drain\-timeout\fR=\fIDRAIN_TIMEOUT\fR; default="0s"

The time period for draining traffic from Internal HTTP(S) Load Balancer proxies
that are assigned addresses in the current ACTIVE subnetwork. For example,
\f5\fI1h\fR\fR, \f5\fI60m\fR\fR and \f5\fI3600s\fR\fR each specify a duration of
1 hour for draining the traffic. Longer times reduce the number of proxies that
are draining traffic at any one time, and so improve the availability of proxies
for load balancing. The drain timeout is only applicable when the
[\-\-role=ACTIVE] flag is being used.

.TP 2m
\fB\-\-external\-ipv6\-prefix\fR=\fIEXTERNAL_IPV6_PREFIX\fR

The /64 external IPv6 CIDR range to assign to this subnet. The range must be
associated with an IPv6 BYOIP sub\-prefix that is defined by the
\-\-ip\-collection flag. If you specify \-\-ip\-collection but not
\-\-external\-ipv6\-prefix, a random /64 range is allocated from the
sub\-prefix.

For example, \f5\-\-external\-ipv6\-prefix=2600:1901:0:0:0:0:0:0/64\fR

.TP 2m
\fB\-\-flow\-sampling\fR=\fIFLOW_SAMPLING\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled. The value
of the field must be in [0, 1]. Set the sampling rate of VPC Flow Logs within
the subnetwork where 1.0 means all collected logs are reported and 0.0 means no
logs are reported. Default is 0.5 which means half of all collected logs are
reported.

.TP 2m
\fB\-\-internal\-ipv6\-prefix\fR=\fIINTERNAL_IPV6_PREFIX\fR

Set internal IPv6 prefix to be allocated for this subnetwork. When ULA is
enabled, the prefix will be ignored.

For example, \f5\-\-internal\-ipv6\-prefix 2600:1901:0:0:0:0:0:0/64\fR

.TP 2m
\fB\-\-ip\-collection\fR=\fIIP_COLLECTION\fR

Resource reference to a public delegated prefix. The PublicDelegatedPrefix must
be a sub\-prefix in EXTERNAL_IPV6_SUBNETWORK_CREATION mode.

.TP 2m
\fB\-\-ipv6\-access\-type\fR=\fIIPV6_ACCESS_TYPE\fR

IPv6 access type can be specified only when the subnet is created, or when the
subnet is first updated to have a stack type of IPV4_IPV6. Once set, the access
type is immutable. \fIIPV6_ACCESS_TYPE\fR must be one of:

.RS 2m
.TP 2m
\fBEXTERNAL\fR
VMs in this subnet can have external IPv6.
.TP 2m
\fBINTERNAL\fR
VMs in this subnet can have internal IPv6.
.RE
.sp


.TP 2m
\fB\-\-logging\-aggregation\-interval\fR=\fILOGGING_AGGREGATION_INTERVAL\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled. Toggles
the aggregation interval for collecting flow logs. Increasing the interval time
will reduce the amount of generated flow logs for long lasting connections.
Default is an interval of 5 seconds per connection.
\fILOGGING_AGGREGATION_INTERVAL\fR must be one of: \fBinterval\-10\-min\fR,
\fBinterval\-15\-min\fR, \fBinterval\-1\-min\fR, \fBinterval\-30\-sec\fR,
\fBinterval\-5\-min\fR, \fBinterval\-5\-sec\fR.

.TP 2m
\fB\-\-logging\-filter\-expr\fR=\fILOGGING_FILTER_EXPR\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled. Export
filter used to define which logs should be generated.

.TP 2m
\fB\-\-logging\-flow\-sampling\fR=\fILOGGING_FLOW_SAMPLING\fR

Can only be specified if VPC Flow logs for this subnetwork is enabled. The value
of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within
the subnetwork where 1.0 means all collected logs are reported and 0.0 means no
logs are reported. Default is 0.5 which means half of all collected logs are
reported.

.TP 2m
\fB\-\-logging\-metadata\fR=\fILOGGING_METADATA\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled.
Configures whether metadata fields should be added to the reported logs. Default
is to exclude all metadata. \fILOGGING_METADATA\fR must be one of: \fBcustom\fR,
\fBexclude\-all\fR, \fBinclude\-all\fR.

.TP 2m
\fB\-\-logging\-metadata\-fields\fR=[\fIMETADATA_FIELD\fR,...]

Can only be specified if VPC Flow Logs for this subnetwork is enabled and
"metadata" is set to CUSTOM_METADATA. The comma\-separated list of metadata
fields that should be added to reported logs.

.TP 2m
\fB\-\-metadata\fR=\fIMETADATA\fR

Can only be specified if VPC Flow Logs for this subnetwork is enabled.
Configures whether metadata fields should be added to the reported logs. Default
is to exclude all metadata. \fIMETADATA\fR must be one of:
\fBexclude\-all\-metadata\fR, \fBinclude\-all\-metadata\fR.

.TP 2m
\fB\-\-region\fR=\fIREGION\fR

Region of the subnetwork to update. If not specified, you might be prompted to
select a region (interactive mode only).

To avoid prompting when this flag is omitted, you can set the
\f5\fIcompute/region\fR\fR property:

.RS 2m
$ gcloud config set compute/region REGION
.RE

A list of regions can be fetched by running:

.RS 2m
$ gcloud compute regions list
.RE

To unset the property, run:

.RS 2m
$ gcloud config unset compute/region
.RE

Alternatively, the region can be stored in the environment variable
\f5\fICLOUDSDK_COMPUTE_REGION\fR\fR.

.TP 2m
\fB\-\-stack\-type\fR=\fISTACK_TYPE\fR

The stack type for this subnet. Determines if IPv6 is enabled on the subnet.
\fISTACK_TYPE\fR must be one of:

.RS 2m
.TP 2m
\fBIPV4_IPV6\fR
New VMs in this subnet can have both IPv4 and IPv6 addresses
.TP 2m
\fBIPV4_ONLY\fR
New VMs in this subnet will only be assigned IPv4 addresses
.RE
.sp


.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-add\-secondary\-ranges\fR=\fIPROPERTY\fR=\fIVALUE\fR,[...]

Adds secondary IP ranges to the subnetwork for use in IP aliasing.

For example, \f5\-\-add\-secondary\-ranges range1=192.168.64.0/24\fR adds a
secondary range 192.168.64.0/24 with name range1.

.RS 2m
.IP "\(bu" 2m
\f5RANGE_NAME\fR \- Name of the secondary range.
.IP "\(bu" 2m
\f5RANGE\fR \- \f5IP range in CIDR format.\fR
.RE
.sp

.TP 2m
\fB\-\-[no\-]allow\-cidr\-routes\-overlap\fR

Allow/disallow this subnetwork's IP address ranges to conflict with existing
static routes. Use \fB\-\-allow\-cidr\-routes\-overlap\fR to enable and
\fB\-\-no\-allow\-cidr\-routes\-overlap\fR to disable.

.TP 2m
\fB\-\-[no\-]enable\-flow\-logs\fR

Enable/disable VPC Flow Logs for this subnet. If the subnet does not support VPC
Flow Logs, this flag has no effect. For more information, see
https://cloud.google.com/vpc/docs/using\-flow\-logs. Use
\fB\-\-enable\-flow\-logs\fR to enable and \fB\-\-no\-enable\-flow\-logs\fR to
disable.

.TP 2m
\fB\-\-[no\-]enable\-private\-ip\-google\-access\fR

Enable/disable access to Google Cloud APIs from this subnet for instances
without a public ip address. Use \fB\-\-enable\-private\-ip\-google\-access\fR
to enable and \fB\-\-no\-enable\-private\-ip\-google\-access\fR to disable.

.TP 2m
\fB\-\-private\-ipv6\-google\-access\-type\fR=\fIPRIVATE_IPV6_GOOGLE_ACCESS_TYPE\fR

The private IPv6 google access type for the VMs in this subnet.
\fIPRIVATE_IPV6_GOOGLE_ACCESS_TYPE\fR must be one of: \fBdisable\fR,
\fBenable\-bidirectional\-access\fR, \fBenable\-outbound\-vm\-access\fR.

.TP 2m
\fB\-\-purpose\fR=\fIPURPOSE\fR

The purpose of the subnetwork can be changed in a few scenarios. \fIPURPOSE\fR
must be one of:

.RS 2m
.TP 2m
\fBPRIVATE\fR
The default subnet type. Only PEER_MIGRATION subnets can be changed to PRIVATE.
.TP 2m
\fBREGIONAL_MANAGED_PROXY\fR
The proxy\-only subnet for regional HTTP(S) load balancers. Only
INTERNAL_HTTPS_LOAD_BALANCER subnets can be changed to REGIONAL_MANAGED_PROXY.
.RE
.sp


.TP 2m
\fB\-\-remove\-secondary\-ranges\fR=\fIPROPERTY\fR=\fIVALUE\fR,[...]

Removes secondary ranges from the subnetwork.

For example, \f5\-\-remove\-secondary\-ranges range2,range3\fR removes the
secondary ranges with names range2 and range3.

.TP 2m
\fB\-\-role\fR=\fIROLE\fR

The role is set to ACTIVE to update a BACKUP reserved address range to be the
new ACTIVE address range. Note that the only supported value for this flag is
ACTIVE since setting an address range to BACKUP is not supported.

This field is only valid when updating a reserved IP address range used for the
purpose of Internal HTTP(S) Load Balancer.

\fIROLE\fR must be (only one value is supported):

.RS 2m
.TP 2m
\fBACTIVE\fR
The ACTIVE subnet that is currently used.
.RE
.sp



.RE
.RE
.sp

.SH "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 \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:

.RS 2m
$ gcloud compute networks subnets update
.RE

.RS 2m
$ gcloud beta compute networks subnets update
.RE