gcloud compute addresses create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud compute addresses create - reserve IP addresses
- SYNOPSIS
gcloud compute addresses create[NAME…][--description=DESCRIPTION][--endpoint-type=ENDPOINT_TYPE][--ip-collection=IP_COLLECTION][--network=NETWORK][--network-tier=NETWORK_TIER][--prefix-length=PREFIX_LENGTH][--purpose=PURPOSE][--subnet=SUBNET][--addresses=ADDRESS,[ADDRESS,…] |--ip-version=IP_VERSION][--global|--region=REGION][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
gcloud compute addresses createis used to reserve one or more IPaddresses. Once an IP address is reserved, it will be associated with theproject until it is released using 'gcloud compute addresses delete'. EphemeralIP addresses that are in use by resources in the project can be reserved usingthe '--addresses' flag.- EXAMPLES
- To reserve three IP addresses in the 'us-central1' region, run:
gcloudcomputeaddressescreateaddress-1address-2address-3--region=us-central1To reserve ephemeral IP addresses '162.222.181.198' and '23.251.146.189' whichare being used by virtual machine instances in the 'us-central1' region, run:
gcloudcomputeaddressescreate--addresses=162.222.181.198,23.251.146.189--region=us-central1In the above invocation, the two addresses will be assigned random names.
To reserve an IP address named subnet-address-1 from the subnet 'default' in the'us-central1' region, run:
gcloudcomputeaddressescreatesubnet-address-1--region=us-central1--subnet=defaultTo reserve an IP range '10.110.0.0/16' from the network 'default' for'VPC_PEERING', run:
gcloudcomputeaddressescreateip-range-1--global--addresses=10.110.0.0--prefix-length=16--purpose=VPC_PEERING--network=defaultTo reserve any IP range with prefix length '16' from the network 'default' for'VPC_PEERING', run:
gcloudcomputeaddressescreateip-range-1--global--prefix-length=16--purpose=VPC_PEERING--network=defaultTo reserve an address from network 'default' for PRIVATE_SERVICE_CONNECT, run:
gcloudcomputeaddressescreatepsc-address-1--global--addresses=10.110.0.10--purpose=PRIVATE_SERVICE_CONNECT--network=default - POSITIONAL ARGUMENTS
- [
NAME…] - Names of the addresses to create.
- [
- FLAGS
--description=DESCRIPTION- An optional textual description for the addresses.
--endpoint-type=ENDPOINT_TYPE- The endpoint type of the external IPv6 address to be reserved.
ENDPOINT_TYPEmust be one of:VM,NETLB. --ip-collection=IP_COLLECTION- If specified, the public delegated prefix (PDP) from which to allocate the BYOIPIP address. The PDP must support enhanced IPv4 allocations. If not specified,the address will be allocated from the Google-owned IP pool.
--network=NETWORK- If specified, the network resource in which the address(es) should be reserved.
This is only available for global internal address, which represents an internalIP range reservation from within the network.
--network-tier=NETWORK_TIER- The network tier to assign to the reserved IP addresses.
must be one of:NETWORK_TIERPREMIUM,STANDARD. The default value isPREMIUM.While regional external addresses (
--regionspecified,--subnetomitted) can use eitherPREMIUMorSTANDARD, global external addresses (--globalspecified,--subnetomitted) can only usePREMIUM.Internal addresses can only usePREMIUM. --prefix-length=PREFIX_LENGTH- The prefix length of the IP range. If the address is an IPv4 address, it must bea value between 8 and 30 inclusive. If the address is an IPv6 address, the onlyallowed value is 96. If not present, it means the address field is a single IPaddress.
This field is not applicable to external IPv4 addresses or global IPv6addresses.
--purpose=PURPOSE- The purpose of the address resource. This field is not applicable to externaladdresses.
PURPOSEmust be one of:VPC_PEERING,SHARED_LOADBALANCER_VIP,GCE_ENDPOINT,IPSEC_INTERCONNECT,PRIVATE_SERVICE_CONNECT. --subnet=SUBNET- If specified, the subnet name in which the address(es) should be reserved. Thesubnet must be in the same region as the address.
The address will represent an internal IP reservation from within the subnet. If--address is specified, it must be within the subnet's IP range.
May not be specified with --global.
- At most one of these can be specified:
--addresses=ADDRESS,[ADDRESS,…]- Ephemeral IP addresses to promote to reserved status. Only addresses that arebeing used by resources in the project can be promoted. When providing thisflag, a parallel list of names for the addresses can be provided. For example,
gcloudcomputeaddressescreateADDRESS-1ADDRESS-2--addresses162.222.181.197,162.222.181.198--regionus-central1will result in 162.222.181.197 being reserved as 'ADDRESS-1' and 162.222.181.198as 'ADDRESS-2'. If no names are given, server-generated names will be assignedto the IP addresses.
--ip-version=IP_VERSION- Version of the IP address to be allocated and reserved. The default is IPV4.
IP version can only be specified for global addresses that are generatedautomatically (i.e., along with the
--globalflag, given--addressesis not specified) and if the--network-tierisPREMIUM.IP_VERSIONmust be one of:IPV4,IPV6.
- At most one of these can be specified:
--global- If set, the addresses are global.
--region=REGION- Region of the addresses to create. Overrides the default
compute/regionproperty value for this command invocation.
- 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
- These variants are also available:
gcloudalphacomputeaddressescreategcloudbetacomputeaddressescreate
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-16 UTC.