Skip to main content

iCloud Private Relay

The cipr icloud command retrieves IP ranges for iCloud Private Relay.

Usage

CLI command
cipr icloud [flags]

Data Format

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

Flags

FlagDescriptionDefaultRequiredMultiple values
--ipv4Get only IPv4 ranges.
--ipv6Get only IPv6 ranges.
--filter-countryFilter results by country.
--filter-regionFilter results by region.
--filter-cityFilter results by city (use quotes for names with spaces, e.g. "New York").
--listList unique values for a dimension instead of IP ranges. Valid: countries, regions, cities.

When neither --ipv4 nor --ipv6 is set, both are fetched. --list composes with the --filter* flags but ignores --ipv4/--ipv6.

Source and caching

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

icloud_endpoint = "https://mask-api.icloud.com/egress-ip-ranges.csv"
icloud_local_file = ""
icloud_cache_ttl = "24h"

Use cipr configure icloud to inspect the effective values. Custom URLs and local files supplied through --source must use the same CSV format as egress-ip-ranges.csv.

Apple updates the list periodically. 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 all iCloud Private Relay IPv4 ranges

CLI command
cipr icloud --ipv4
Output
...
104.28.129.23/32
104.28.129.24/32
...

Get all iCloud Private Relay IPv6 ranges

CLI command
cipr icloud --ipv6
Output
...
2a02:26f7:f6f9:800::/54
2a02:26f7:f6f9:a06a::/64
...

Filter results by country

CLI command
cipr icloud --filter-country US
Output
...
104.28.129.23/32
2a02:26f7:f6f9:800::/54
...

Filter results by region

CLI command
cipr icloud --filter-region US-CA
Output
...
104.28.129.23/32
2a02:26f7:f6f9:800::/54
...

Filter results by city

CLI command
cipr icloud --filter-city "New York"
Output
...
104.28.129.23/32
2a02:26f7:f6f9:800::/54
...

Set verbosity level to full

CLI command
cipr icloud --ipv6 --filter-country JP -v
Output
...
IP Range: 2a04:4e41:0064:000a::/64, Country: JP, Region: JP-13, City: TOKAI
IP Range: 2a04:4e41:0064:000b::/64, Country: JP, Region: JP-13, City: TOKYO
...

List all countries

CLI command
cipr icloud --list countries
Output
...
DE
GB
JP
US
...

List cities in JP-13 (Tokyo subdivision)

CLI command
cipr icloud --filter-region JP-13 --list cities
Output
...
TOKAI
TOKYO
Tokyo
...