Skip to main content

Google Cloud

The cipr gcp command retrieves global and regional external IPv4 and IPv6 ranges available to Google Cloud resources.

Usage

CLI command
cipr gcp [flags]

Data Format

See the Google Cloud command data format for output fields and filter-value guidance.

Flags

FlagDescriptionDefaultRequiredMultiple values
--ipv4Get only IPv4 ranges.
--ipv6Get only IPv6 ranges.
--filterFilter results using one string. Syntax: scope,service.
--filter-scopeFilter by Google Cloud scope, such as asia-east1 or global.
--filter-serviceFilter by the feed's service label, currently Google Cloud.
--listList unique values instead of IP ranges. Valid dimensions: scopes, services.

The individual filter flags accept comma-separated values. Values within one flag use OR matching, while separate filter flags use AND matching. For example, --filter-scope asia-east1,global --filter-service 'Google Cloud' selects Google Cloud ranges in either scope.

--filter keeps its scope,service syntax and cannot be combined with --filter-scope or --filter-service. Filters are case-insensitive. When neither or both IP-family flags are set, both IPv4 and IPv6 ranges are returned.

--list composes with the filter flags, ignores --ipv4 and --ipv6, and prints sorted unique values. Scopes are Google Cloud region names or global. The service field is currently Google Cloud; it does not identify individual products or APIs.

Source and caching

The configured source key is gcp, with these default settings:

gcp_endpoint = "https://www.gstatic.com/ipranges/cloud.json"
gcp_local_file = ""
gcp_cache_ttl = "24h"

Use cipr configure gcp to inspect the effective values. Custom URLs and local files supplied through --source must use the same JSON schema as cloud.json.

info

These ranges cover addresses available to Google Cloud customers. They are not project-specific allocations or the broader ranges used by Google APIs and services. Google explains the distinction in its VPC documentation.

Google updates the feed frequently. Use --no-cache when a run must fetch the current publication instead of a valid cached response.

Examples

tip

IP ranges in the output examples are snapshots and might not be current.

Get Google Cloud IPv4 ranges for asia-east1

CLI command
cipr gcp --ipv4 --filter-scope asia-east1
Output
...
34.80.0.0/15
34.137.0.0/16
...

Get global IPv6 ranges with mini verbosity

CLI command
cipr gcp --ipv6 --filter 'global,Google Cloud' --verbose-mode mini
Output
2600:1901::/48,global,Google Cloud

Get global ranges with full verbosity

CLI command
cipr gcp --filter-scope global --verbose
Output
...
IP Prefix: 8.228.224.0/20, Scope: global, Service: Google Cloud
IP Prefix: 2600:1901::/48, Scope: global, Service: Google Cloud
...

Get ranges from either asia-east1 or global

CLI command
cipr gcp --filter-scope asia-east1,global

List all Google Cloud scopes

CLI command
cipr gcp --list scopes
Output
...
africa-south1
asia-east1
global
us-central1
...

List services available in asia-east1

CLI command
cipr gcp --filter-scope asia-east1 --list services
Output
Google Cloud