Google Cloud
The cipr gcp command retrieves global and regional external IPv4 and IPv6 ranges available to Google Cloud resources.
Usage
cipr gcp [flags]
Data Format
See the Google Cloud command data format for output fields and filter-value guidance.
Flags
| Flag | Description | Default | Required | Multiple values |
|---|---|---|---|---|
--ipv4 | Get only IPv4 ranges. | ❌ | ❌ | ❌ |
--ipv6 | Get only IPv6 ranges. | ❌ | ❌ | ❌ |
--filter | Filter results using one string. Syntax: scope,service. | ❌ | ❌ | ❌ |
--filter-scope | Filter by Google Cloud scope, such as asia-east1 or global. | ❌ | ❌ | ✅ |
--filter-service | Filter by the feed's service label, currently Google Cloud. | ❌ | ❌ | ✅ |
--list | List 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.
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
IP ranges in the output examples are snapshots and might not be current.
Get Google Cloud IPv4 ranges for asia-east1
cipr gcp --ipv4 --filter-scope asia-east1
...
34.80.0.0/15
34.137.0.0/16
...
Get global IPv6 ranges with mini verbosity
cipr gcp --ipv6 --filter 'global,Google Cloud' --verbose-mode mini
2600:1901::/48,global,Google Cloud
Get global ranges with full verbosity
cipr gcp --filter-scope global --verbose
...
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
cipr gcp --filter-scope asia-east1,global
List all Google Cloud scopes
cipr gcp --list scopes
...
africa-south1
asia-east1
global
us-central1
...
List services available in asia-east1
cipr gcp --filter-scope asia-east1 --list services
Google Cloud