Create and manage subnetworks

This page describes how to create and manage Google Distributed Cloud subnetwork resources in a Distributed Cloud connected zone.

On Distributed Cloud connected servers, you can only configure subnetworks with VLAN IDs. CIDR-based subnetworks are not supported on Distributed Cloud connected servers.

For more information about Distributed Cloud subnetworks, see How Distributed Cloud connected works.

Keep the following in mind:

  • You can create up to 138 subnetworks per Distributed Cloud zone.
  • The subnetwork is a VLAN within the parent network. As such, each subnetwork must have a globally unique VLAN ID. Distributed Cloud connected does not allow the reuse of VLAN IDs.
  • To have Distributed Cloud connected assign an unused VLAN ID at random, specify 0 as the VLAN ID when you create the subnetwork.
  • The subnetwork is accessible to all nodes in your Distributed Cloud connected zone.

Create a subnetwork

To create a Distributed Cloud subnetwork, complete the steps in this section.

To complete this task, you must have the Edge Network Admin role (roles/edgenetwork.admin) in your Google Cloud project.

gcloud

Use the gcloud edge-cloud networking subnets create command:

gcloud edge-cloud networking subnets create SUBNETWORK_NAME \
    --network=NETWORK_NAME \
    --ipv4-range=IPV4_RANGE \
    --ipv6-range=IPV6_RANGE \
    --vlan-id=VLAN_ID \
    --location=REGION \
    --zone=ZONE_NAME

Replace the following:

  • SUBNETWORK_NAME: a descriptive name that uniquely identifies this subnetwork.
  • NETWORK_NAME: the network that encapsulates this subnetwork.
  • IPV4_RANGE: the IPv4 address range that this subnetwork covers in the IP address/prefix format.
  • IPV6_RANGE: the IPv6 address range that this subnetwork covers in the IP address/prefix format.
  • VLAN_ID: the target VLAN ID for this subnetwork.
  • REGION: the Google Cloud region to which the target Distributed Cloud zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.

API

Make a POST request to the projects.locations.zones.subnets.create method:

 POST /v1/projects/PROJECT_ID/locations/REGION/zones/ZONE_NAME/subnets?subnetId=SUBNETWORK_ID
 {
  "labels": { LABELS,
   },
  "network": { NETWORK_NAME,
   },
  "ipv4Cidr": { IPV4_RANGE,
   },
  "ipv6Cidr": { IPV6_RANGE,
   },       
  "vlanId": { VLAN_ID,
   },
 }     

Replace the following:

  • PROJECT_ID: the ID of the target Google Cloud project.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.
  • SUBNETWORK_ID: an ID that uniquely identifies this subnetwork.
  • LABELS: a list of labels to apply to this subnetwork resource.
  • NETWORK_NAME: the network that encapsulates this subnetwork.
  • IPV4_RANGE: the IPv4 address range that this subnetwork covers in the IP address/prefix format.
  • IPV6_RANGE: the IPv6 address range that this subnetwork covers in the IP address/prefix format.
  • VLAN_ID: the target VLAN ID for this subnetwork.

List subnetworks

To list subnetworks provisioned within a Distributed Cloud connected zone, complete the steps in this section.

To complete this task, you must have the Edge Network Viewer role (roles/edgenetwork.viewer) in your Google Cloud project.

gcloud

Use the gcloud edge-cloud networking subnets list command:

gcloud edge-cloud networking subnets list \
    --location=REGION \
    --zone=ZONE_NAME

Replace the following:

  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.

API

Make a GET request to the projects.locations.zones.subnets.list method:

 GET /v1/projects/PROJECT_ID/locations/REGION/zones/ZONE_NAME/subnets?filter=FILTER&pageSize=PAGE_SIZE&orderBy=SORT_BY&pageToken=PAGE_TOKEN

Replace the following:

  • PROJECT_ID: the ID of the target Google Cloud project.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.
  • FILTER: an expression that constrains the returned results to specific values.
  • PAGE_SIZE: the number of results to return per page.
  • SORT_BY: a comma-delimited list of field names by which the returned results are sorted. The default sort order is ascending; for descending sort order, prefix the desired field with ~.
  • PAGE_TOKEN: a token received in the response to the last list request in the nextPageToken field in the response. Send this token to receive a page of results.

Get information about a subnetwork

To get information about a Distributed Cloud subnetwork, complete the steps in this section.

To complete this task, you must have the Edge Network Viewer role (roles/edgenetwork.viewer) in your Google Cloud project.

gcloud

Use the gcloud edge-cloud networking subnets describe command:

gcloud edge-cloud networking subnets describe SUBNETWORK_NAME \
    --location=REGION \
    --zone=ZONE_NAME

Replace the following:

  • SUBNETWORK_NAME: the name of the target subnetwork.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.

API

Make a GET request to the projects.locations.zones.subnets.get method:

 GET /v1/projects/PROJECT_ID/locations/REGION/zones/ZONE_NAME/subnets/SUBNETWORK_ID

Replace the following:

  • PROJECT_ID: the ID of the target Google Cloud project.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.
  • SUBNETWORK_NAME: the name of the target subnetwork.

This operation returns detailed information about the resource, including its provisioning state:

  • PENDING: the resource has not yet begun provisioning and has not yet been propagated throughout the zone.
  • PROVISIONING: the resource is being provisioned; you must wait until it has been propagated throughout the zone.
  • RUNNING: the resource has been successfully provisioned and propagated throughout the zone; it is ready to use.
  • FAILED: the provisioning of the resource was not successful; the resource has not been propagated throughout the zone.

Delete a subnetwork

To delete a Distributed Cloud subnetwork, complete the steps in this section.

To complete this task, you must have the Edge Network Admin role (roles/edgenetwork.admin) in your Google Cloud project.

gcloud

Use the gcloud edge-cloud networking subnets delete command:

gcloud edge-cloud networking subnets delete SUBNETWORK_NAME \
    --location=REGION \
    --zone=ZONE_NAME

Replace the following:

  • SUBNETWORK_NAME: the name of the target subnetwork.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.

API

Make a DELETE request to the projects.locations.zones.subnets.delete method:

 DELETE /v1/projects/PROJECT_ID/locations/REGION/zones/ZONE_NAME/subnets/SUBNETWORK_ID

Replace the following:

  • PROJECT_ID: the ID of the target Google Cloud project.
  • REGION: the Google Cloud region to which the target Distributed Cloud connected zone belongs.
  • ZONE_NAME: the name of the target Distributed Cloud connected zone.
  • SUBNETWORK_NAME: the name of the target subnetwork.

What's next