gcloud network-connectivity internal-ranges create - create a new internal range
gcloud network-connectivity internal-ranges create (INTERNAL_RANGE : --region=REGION) --network=NETWORK (--ip-cidr-range=IP_CIDR_RANGE | [--prefix-length=PREFIX_LENGTH : --target-cidr-range=[TARGET_CIDR_RANGE,...]]) [--async] [--description=DESCRIPTION] [--labels=KEY=VALUE] [--overlaps=[OVERLAPS,...]] [--peering=PEERING; default="for-self"] [--usage=USAGE; default="for-vpc"] [GCLOUD_WIDE_FLAG ...]
Create a new internal range with the given name.
Create an internal range with name my-range and ip-cidr-range 192.168.0.0/25 in network https://www.googleapis.com/compute/v1/projects/my-project/locations/global/networks/my-network:
$ gcloud network-connectivity internal-ranges create my-range \ --ip-cidr-range="192.168.0.0/25" \ --network="https://www.googleapis.com/compute/v1/projects/my-pro\ ject/locations/global/networks/my-network" --project=my-project
Create an internal range with name my-range and auto-allocated /25 block (prefix-length 25) in network my-network:
$ gcloud network-connectivity internal-ranges create my-range \ --prefix-length=25 --network="my-network" --project=my-project
- Internal range resource - Name of the internal range to be created. The
arguments in this group can be used to specify the attributes of this resource. (NOTE) Some attributes are not given arguments in this group but can be set in other ways. To set the project attribute:
- —
provide the argument internal_range on the command line with a fully specified name;
- —
set the property core/project;
- —
provide the argument --project on the command line.
This must be specified.
- INTERNAL_RANGE
ID of the internal range or fully qualified identifier for the internal range. To set the internal_range attribute:
provide the argument internal_range on the command line.
This positional argument must be specified if any of the other arguments in this group are specified.
- --region=REGION
The location ID.
To set the region attribute:
provide the argument internal_range on the command line with a fully specified name;
provide the argument --region on the command line;
use default global location .
- --network=NETWORK
The URL or resource ID of the network in which to reserve the internal range. Legacy network is not supported. This can only be specified for a global internal address.
For example:
- —
https://www.googleapis.com/compute/v1/projects/my-project/locations/global/networks/my-network
- —
/projects/my-project/locations/global/networks/my-network
- —
my-network
- Exactly one of these must be specified:
- --ip-cidr-range=IP_CIDR_RANGE
IP range that this internal range defines.
- --prefix-length=PREFIX_LENGTH
An alternative to ip-cidr-range. Can be set when trying to create a reservation that automatically finds a free range of the given size.
This flag argument must be specified if any of the other arguments in this group are specified.
- --target-cidr-range=[TARGET_CIDR_RANGE,...]
Can be set to narrow down or pick a different address space while searching for a free range. If not set, defaults to the "10.0.0.0/8" address space. This can be used to search in other rfc-1918 address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC.
- --async
Return immediately, without waiting for the operation in progress to complete.
- --description=DESCRIPTION
Description of the internal range to be created.
- --labels=KEY=VALUE
List of label KEY=VALUE pairs to add.
- --overlaps=[OVERLAPS,...]
Overlap specifications for the range being created. OVERLAPS must be (currently only one value is supported):
- overlap-route-range
Allows for creation or existence of routes that have a more specific destination than the created range.
- --peering=PEERING; default="for-self"
The type of peering set for the internal range. PEERING must be one of:
- for-peer
This behavior can be set when the internal range is being reserved for usage by the peers. This means that no resource within the VPC in which it is being created can use this to associate with a cloud resource, but one of the peers can. This represents "donating" a range for peers to use.
- for-self
This beharior represents the case that the internal range is intended to be used in the VPC on which it is created and is accessible from its peers. This implies that peers or peer-of-peers cannot use this range.
- not-shared
This behavior can be set when the internal range is being reserved for usage by the VPC on which it is created but not shared with the peers. In a sense it is local to the VPC. This can be used to create internal ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for interconnect routes that are not shared with peers. This also implies that peers cannot use this range in a way that is visible to this VPC, but can re-use this range as long as it is NOT_SHARED from the peer VPC too.
- --usage=USAGE; default="for-vpc"
The type of usage set for the internal range. USAGE must be one of:
- external-to-vpc
Ranges created with EXTERNAL_TO_VPC cannot be associated with cloud resources and are meant to block out address ranges for various use cases, like for example, usage on-prem, with dynamic route announcements via interconnect.
- for-vpc
A cloud resource can use the reserved CIDR block by associating it with the internal range resource if usage is set to FOR_VPC.
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.
This command uses the networkconnectivity/v1 API. The full documentation for this API can be found at: https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
This variant is also available:
$ gcloud alpha network-connectivity internal-ranges create