gcloud compute vpn-tunnels create NAME --shared-secret=SHARED_SECRET (--peer-address=PEER_ADDRESS | --peer-external-gateway=PEER_EXTERNAL_GATEWAY | --peer-gcp-gateway=PEER_GCP_GATEWAY | --peer-gcp-gateway-region=PEER_GCP_GATEWAY_REGION) (--target-vpn-gateway=TARGET_VPN_GATEWAY | --target-vpn-gateway-region=TARGET_VPN_GATEWAY_REGION | --vpn-gateway=VPN_GATEWAY | --vpn-gateway-region=VPN_GATEWAY_REGION) [--description=DESCRIPTION] [--ike-version=IKE_VERSION] [--interface=INTERFACE] [--local-traffic-selector=CIDR,[CIDR,…]] [--peer-external-gateway-interface=PEER_EXTERNAL_GATEWAY_INTERFACE] [--phase1-dh=GROUPS,[GROUPS,…]] [--phase1-encryption=ALGORITHMS,[ALGORITHMS,…]] [--phase1-integrity=ALGORITHMS,[ALGORITHMS,…]] [--phase1-prf=PSEUDORANDOM FUNCTIONS,[…]] [--phase2-encryption=ALGORITHMS,[ALGORITHMS,…]] [--phase2-integrity=ALGORITHMS,[ALGORITHMS,…]] [--phase2-pfs=ALGORITHMS,[ALGORITHMS,…]] [--region=REGION] [--remote-traffic-selector=CIDR,[CIDR,…]] [--resource-manager-tags=[KEY=VALUE,…]] [--router=ROUTER] [--router-region=ROUTER_REGION] [GCLOUD_WIDE_FLAG …]
gcloud compute vpn-tunnels create is used to create a Classic VPN
tunnel between a target VPN gateway in Google Cloud Platform and a peer address;
or create Highly Available VPN tunnel between HA VPN gateway and another HA VPN
gateway, or Highly Available VPN tunnel between HA VPN gateway and an external
VPN gateway.
NAME--shared-secret=SHARED_SECRET--peer-address=PEER_ADDRESS--peer-external-gateway=PEER_EXTERNAL_GATEWAY--peer-gcp-gateway=PEER_GCP_GATEWAY--peer-gcp-gateway-region=PEER_GCP_GATEWAY_REGIONcompute/region property value for this command invocation.
--target-vpn-gateway=TARGET_VPN_GATEWAY--target-vpn-gateway-region=TARGET_VPN_GATEWAY_REGIONcompute/region property value for this command invocation.
--vpn-gateway=VPN_GATEWAY--vpn-gateway-region=VPN_GATEWAY_REGIONcompute/region property value for this command invocation.
--description=DESCRIPTION--ike-version=IKE_VERSIONIKE_VERSION must be one of: 1,
2.
--interface=INTERFACEINTERFACE must be one of:
0, 1.
--local-traffic-selector=CIDR,[CIDR,…]--local-traffic-selector allows to configure the local addresses that are permitted. The value should be a comma separated list of CIDR formatted strings. Example: 192.168.0.0/16,10.0.0.0/24.
Local traffic selector must be specified only for VPN tunnels that do not use dynamic routing with a Cloud Router. Omit this flag when creating a tunnel using dynamic routing, including a tunnel for a Highly Available VPN gateway.--peer-external-gateway-interface=PEER_EXTERNAL_GATEWAY_INTERFACEPEER_EXTERNAL_GATEWAY_INTERFACE must be one of:
0, 1, 2, 3.
--phase1-dh=GROUPS,[GROUPS,…]--phase1-encryption=ALGORITHMS,[ALGORITHMS,…]--phase1-integrity=ALGORITHMS,[ALGORITHMS,…]--phase1-prf=PSEUDORANDOM FUNCTIONS,[…]--phase2-encryption=ALGORITHMS,[ALGORITHMS,…]--phase2-integrity=ALGORITHMS,[ALGORITHMS,…]--phase2-pfs=ALGORITHMS,[ALGORITHMS,…]--region=REGION
To avoid prompting when this flag is omitted, you can set the
property:
compute/region
gcloud config set compute/region REGIONA list of regions can be fetched by running:
gcloud compute regions listTo unset the property, run:
gcloud config unset compute/regionCLOUDSDK_COMPUTE_REGION.
--remote-traffic-selector=CIDR,[CIDR,…]--remote-traffic-selector allows to configure the remote addresses that are permitted. The value should be a comma separated list of CIDR formatted strings. Example: 192.168.0.0/16,10.0.0.0/24.
Remote traffic selector must be specified for VPN tunnels that do not use dynamic routing with a Cloud Router. Omit this flag when creating a tunnel using dynamic routing, including a tunnel for a Highly Available VPN gateway.--resource-manager-tags=[KEY=VALUE,…]--router=ROUTER--router-region=ROUTER_REGION
To avoid prompting when this flag is omitted, you can set the
property:
compute/region
gcloud config set compute/region REGIONA list of regions can be fetched by running:
gcloud compute regions listTo unset the property, run:
gcloud config unset compute/regionCLOUDSDK_COMPUTE_REGION.
--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.
gcloud alpha compute vpn-tunnels creategcloud beta compute vpn-tunnels creategcloud preview compute vpn-tunnels create
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.