gcloud alpha compute diagnose routes

NAME
gcloud alpha compute diagnose routes - routes to/from Compute Engine virtual machine instances
SYNOPSIS
gcloud alpha compute diagnose routes[NAME …][--container=CONTAINER][--dry-run][--external-route-ip=EXTERNAL_ROUTE_IP][--force-key-file-overwrite][--plain][--regexp=REGEXP,-rREGEXP][--reverse-traceroute][--ssh-flag=SSH_FLAG][--ssh-key-file=SSH_KEY_FILE][--strict-host-key-checking=STRICT_HOST_KEY_CHECKING][--user=USER][--zones=ZONE,[ZONE,…]][--ssh-key-expiration=SSH_KEY_EXPIRATION    |--ssh-key-expire-after=SSH_KEY_EXPIRE_AFTER][GCLOUD_WIDE_FLAG][--TRACEROUTE_ARGS …]
DESCRIPTION
(ALPHA) Routes to/from Compute Engine virtual machine instances.

NOTE: The name filtering will cycle through all the VMs in the project.Depending on the size of the project, this could be a considerable amount ofwork.

If that is the case, use the --regexp flag to filter down the amount of VMsconsidered in the filtering.

EXAMPLES
To route to/from Compute Engine virtual machine instances, run:
gcloudalphacomputediagnoseroutes
POSITIONAL ARGUMENTS
[NAME …]
If provided, show details for the specified names and/or URIs of resources.
[--TRACEROUTE_ARGS …]
Flags and positionals passed to the underlying traceroute call.The '--' argument must be specified between gcloud specific args on the left andTRACEROUTE_ARGS on the right. Example:
gcloudalphacomputediagnoseroutesexample-instance---w0.5-q542
FLAGS
--container=CONTAINER
The name or ID of a container inside of the virtual machine instance to connectto. This only applies to virtual machines that are using a Container-OptimizedOS virtual machine image. For more information, seehttps://cloud.google.com/compute/docs/containers
--dry-run
Print the equivalent scp/ssh command that would be run to stdout, instead ofexecuting it.
--external-route-ip=EXTERNAL_ROUTE_IP
For reverse traceroute, this will be the ip given to the VM instance totraceroute to. This will override all obtained ips.
--force-key-file-overwrite
If enabled, the gcloud command-line tool will regenerate and overwrite the filesassociated with a broken SSH key without asking for confirmation in bothinteractive and non-interactive environments.

If disabled, the files associated with a broken SSH key will not be regeneratedand will fail in both interactive and non-interactive environments.

--plain
Suppress the automatic addition ofssh(1)/scp(1)flags. This flag is useful if you want to take care of authentication yourselfor use specific ssh/scp features.
--regexp=REGEXP,-rREGEXP
Regular expression to filter the names of the results on. Any names that do notmatch the entire regular expression will be filtered out.
--reverse-traceroute
If enabled, will also run traceroute from the VM to the host
--ssh-flag=SSH_FLAG
Additional flags to be passed tossh(1). It is recommended thatflags be passed using an assignment operator and quotes. This flag will replaceoccurences of%USER% and%INSTANCE% with their dereferenced values.Example:
gcloudalphacomputediagnoseroutesexample-instance--zoneus-central1-a--ssh-flag="-vvv"--ssh-flag="-L 80:%INSTANCE%:80"

is equivalent to passing the flags--vvvand-L 80:162.222.181.197:80 tossh(1) if the external IP address of 'example-instance' is162.222.181.197.

--ssh-key-file=SSH_KEY_FILE
The path to the SSH key file. By default, this is~/.ssh/google_compute_engine.
--strict-host-key-checking=STRICT_HOST_KEY_CHECKING
Override the default behavior of StrictHostKeyChecking for the connection. Bydefault, StrictHostKeyChecking is set to 'no' the first time you connect to aninstance, and will be set to 'yes' for all subsequent connections.STRICT_HOST_KEY_CHECKING must be one of:yes,no,ask.
--user=USER
User for login to the selected VMs. If not specified, the default user will beused.
--zones=ZONE,[ZONE,…]
If provided, only resources from the given zones are queried.
At most one of these can be specified:
--ssh-key-expiration=SSH_KEY_EXPIRATION
The time when the ssh key will be valid until, such as"2017-08-29T18:52:51.142Z." This is only valid if the instance is not using OSLogin. See $gcloud topicdatetimes for information on time formats.
--ssh-key-expire-after=SSH_KEY_EXPIRE_AFTER
The maximum length of time an SSH key is valid for once created and installed,e.g. 2m for 2 minutes. See $gcloud topic datetimes forinformation on duration formats.
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.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudcomputediagnoseroutes
gcloudbetacomputediagnoseroutes

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-05-07 UTC.