gcloud network-management connectivity-tests create

NAME
gcloud network-management connectivity-tests create - create a new connectivity test
SYNOPSIS
gcloud network-management connectivity-tests createCONNECTIVITY_TEST(--destination-cloud-sql-instance=DESTINATION_CLOUD_SQL_INSTANCE--destination-forwarding-rule=DESTINATION_FORWARDING_RULE--destination-gke-master-cluster=DESTINATION_GKE_MASTER_CLUSTER--destination-gke-pod=DESTINATION_GKE_POD--destination-instance=DESTINATION_INSTANCE--destination-ip-address=DESTINATION_IP_ADDRESS--destination-redis-cluster=DESTINATION_REDIS_CLUSTER--destination-redis-instance=DESTINATION_REDIS_INSTANCE)(--source-app-engine-version=SOURCE_APP_ENGINE_VERSION--source-cloud-function=SOURCE_CLOUD_FUNCTION--source-cloud-run-revision=SOURCE_CLOUD_RUN_REVISION--source-cloud-sql-instance=SOURCE_CLOUD_SQL_INSTANCE--source-gke-master-cluster=SOURCE_GKE_MASTER_CLUSTER--source-gke-pod=SOURCE_GKE_POD--source-instance=SOURCE_INSTANCE--source-ip-address=SOURCE_IP_ADDRESS)[--async][--bypass-firewall-checks][--description=DESCRIPTION][--destination-fqdn=DESTINATION_FQDN][--destination-network=DESTINATION_NETWORK][--destination-port=DESTINATION_PORT][--destination-project=DESTINATION_PROJECT][--labels=[KEY=VALUE,…]][--other-projects=[OTHER_PROJECTS,…]][--protocol=PROTOCOL][--round-trip][--source-network=SOURCE_NETWORK][--source-network-type=SOURCE_NETWORK_TYPE; default="unspecified"][--source-project=SOURCE_PROJECT][GCLOUD_WIDE_FLAG]
DESCRIPTION
Create a new connectivity test with the given name.
EXAMPLES
The following command creates a connectivity test with the name my-test, and thetest between a source VM and a destination IP address in a peering network.
gcloudnetwork-managementconnectivity-testscreatemy-test--source-instance=projects/my-project/zones/us-west-1/instances/my-instance--destination-ip-address=10.142.0.2--destination-network=projects/my-project/global/networks/peering-network
POSITIONAL ARGUMENTS
Connectivity test resource - Name of the connectivity test you want to create.This represents a Cloud resource. (NOTE) Some attributes are not given argumentsin this group but can be set in other ways.

To set theproject attribute:

  • provide the argumentconnectivity_test on the command line with afully specified name;
  • provide the argument--project on the command line;
  • set the propertycore/project.

This must be specified.

CONNECTIVITY_TEST
ID of the connectivity test or fully qualified identifier for the connectivitytest.

To set theconnectivity_test attribute:

  • provide the argumentconnectivity_test on the command line.
REQUIRED FLAGS
At least one of these must be specified:
--destination-cloud-sql-instance=DESTINATION_CLOUD_SQL_INSTANCE
A Cloud SQL instance URI as the destination endpoint.
--destination-forwarding-rule=DESTINATION_FORWARDING_RULE
A forwarding rule URI as the destination endpoint.
--destination-gke-master-cluster=DESTINATION_GKE_MASTER_CLUSTER
A cluster URI for Google Kubernetes Engine master as the destination endpoint.
--destination-gke-pod=DESTINATION_GKE_POD
A GKE Pod URI as the destination endpoint.
--destination-instance=DESTINATION_INSTANCE
A Compute Engine instance URI as the destination endpoint.
--destination-ip-address=DESTINATION_IP_ADDRESS
The IP address of the destination which can be an external or internal IP.
--destination-redis-cluster=DESTINATION_REDIS_CLUSTER
A Redis cluster URI as the destination endpoint.
--destination-redis-instance=DESTINATION_REDIS_INSTANCE
A Redis instance URI as the destination endpoint.
At least one of these must be specified:
--source-app-engine-version=SOURCE_APP_ENGINE_VERSION
App Engine version URI as the source endpoint.
--source-cloud-function=SOURCE_CLOUD_FUNCTION
A Cloud function URI as the source endpoint.
--source-cloud-run-revision=SOURCE_CLOUD_RUN_REVISION
Cloud Run revision URI as the source endpoint.
--source-cloud-sql-instance=SOURCE_CLOUD_SQL_INSTANCE
A Cloud SQL instance URI as the source endpoint.
--source-gke-master-cluster=SOURCE_GKE_MASTER_CLUSTER
A cluster URI for Google Kubernetes Engine master as the source endpoint.
--source-gke-pod=SOURCE_GKE_POD
A GKE Pod URI as the source endpoint.
--source-instance=SOURCE_INSTANCE
A Compute Engine instance URI as the source endpoint.
--source-ip-address=SOURCE_IP_ADDRESS
The IP address of the source which can be an external or internal IP.
OPTIONAL FLAGS
--async
Return immediately, without waiting for the operation in progress to complete.
--bypass-firewall-checks
This boolean controls whether to skip firewall checking.
--description=DESCRIPTION
The description of the connectivity test.
--destination-fqdn=DESTINATION_FQDN
A hostname as the destination endpoint. Only applicable for Google KubernetesEngine.
--destination-network=DESTINATION_NETWORK
A VPC network URI for the destination endpoint. Used only when the source is anexternal IP address endpoint, and the destination is an internal IP addressendpoint.
--destination-port=DESTINATION_PORT
The IP protocol port of the destination. Only applicable when protocol is TCP orUDP.
--destination-project=DESTINATION_PROJECT
Project ID of the destination endpoint.
--labels=[KEY=VALUE,…]
List of label KEY=VALUE pairs to add.
--other-projects=[OTHER_PROJECTS,…]
IDs of other projects involved in the connectivity test, besides the source anddestination project.
--protocol=PROTOCOL
Type of protocol for the test. When not provided, "TCP" is assumed.
--round-trip
This boolean controls whether return traces (from the destination to the source)will be additionally calculated if packet successfully reaches the destinationfrom the source.
--source-network=SOURCE_NETWORK
A VPC network URI for the source endpoint. Used according to thesource-network-type flag.
--source-network-type=SOURCE_NETWORK_TYPE; default="unspecified"
Type of the network where the source is located.SOURCE_NETWORK_TYPE must be one of:
gcp-network
A VPC network. Should be used for internal IP addresses in VPC networks. Thesource-network field should be set to the URI of this network. Onlyendpoints within this network will be considered.
internet
Internet. Should be used for internet-routable external IP addresses or IPaddresses for global Google APIs and services.
non-gcp-network
A network outside of Google Cloud (for example, an on-premises network oranother cloud provider network). Should be used for internal IP addressesoutside of Google Cloud. Thesource-network field should be set tothe URI of the VPC network containing a corresponding Cloud VPN tunnel, CloudInterconnect VLAN attachment, or a router appliance instance. Only endpointsreachable from the provided VPC network via the routes to networks outside ofGoogle Cloud will be considered.
unspecified
Unspecified. The test will analyze all possible IP address locations. This mighttake longer and produce inaccurate or ambiguous results, so prefer specifying anexplicit network type. Thesource-project field should be set tothe project where the Google Cloud endpoint is located, or where the endpointoutside of Google Cloud should be reachable from (via routes to networks outsideof Google Cloud). The project might also be inferred from the Connectivity Testproject or other projects referenced in the request.
--source-project=SOURCE_PROJECT
Project ID of the source endpoint.
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 help for details.

API REFERENCE
This command uses thenetworkmanagement/v1 API. The fulldocumentation for this API can be found at:https://cloud.google.com/
NOTES
This variant is also available:
gcloudbetanetwork-managementconnectivity-testscreate

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 2026-02-03 UTC.