Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Forked from n0531m/list_gcp_iprange.sh
Last active July 30, 2021 08:28
Show Gist options
  • Save jeffmccune/e7d635116f25bc7e12b2a19efbafcdf8 to your computer and use it in GitHub Desktop.
Save jeffmccune/e7d635116f25bc7e12b2a19efbafcdf8 to your computer and use it in GitHub Desktop.
Google Cloud Platform : ip address range
#! /bin/bash
#
# Return the subnets used by Google Services
#
# There are a growing number of netblocks, 2,3,4,5,6,7, etc...
# Dig them all until an empty string is returned.
txt="$(dig TXT _netblocks.google.com +short @8.8.8.8)"
idx=2
while [[ -n "${txt}" ]]; do
echo "$txt" | tr '[:space:]+' "\n" | grep : | cut -d: -f2-
txt="$(dig TXT _netblocks${idx}.google.com +short @8.8.8.8)"
((idx++))
done
@jeffmccune
Copy link
Author

35.190.247.0/24
64.233.160.0/19
66.102.0.0/20
66.249.80.0/20
72.14.192.0/18
74.125.0.0/16
108.177.8.0/21
173.194.0.0/16
209.85.128.0/17
216.58.192.0/19
216.239.32.0/19
172.217.0.0/19
172.217.32.0/20
172.217.128.0/19
172.217.160.0/20
172.217.192.0/19
172.253.56.0/21
172.253.112.0/20
108.177.96.0/19
35.191.0.0/16
130.211.0.0/22
74.114.24.0/21
136.112.0.0/12
172.217.224.0/19
208.81.188.0/22
209.85.218.92/30
209.85.161.92/30
209.85.210.220/30
35.190.247.0/24
64.233.160.0/19
66.102.0.0/20
66.249.80.0/20
72.14.192.0/18
74.125.0.0/16
108.177.8.0/21
173.194.0.0/16
209.85.128.0/17
216.58.192.0/19
216.239.32.0/19
172.217.0.0/19
172.217.32.0/20
172.217.128.0/19
172.217.160.0/20
172.217.192.0/19
172.253.56.0/21
172.253.112.0/20
108.177.96.0/19
35.191.0.0/16
130.211.0.0/22
2001:4860:4000::/36
2404:6800:4000::/36
2607:f8b0:4000::/36
2800:3f0:4000::/36
2a00:1450:4000::/36
2c0f:fb50:4000::/36
2a00:1450:4864:20::65c/126
2607:f8b0:4864:20::c5c/126
2607:f8b0:4864:20::45c/126
2001:4860:4000::/36
2404:6800:4000::/36
2607:f8b0:4000::/36
2800:3f0:4000::/36
2a00:1450:4000::/36
2c0f:fb50:4000::/36

@jeffmccune
Copy link
Author

35.190.247.0/24
64.233.160.0/19
66.102.0.0/20
66.249.80.0/20
72.14.192.0/18
74.125.0.0/16
108.177.8.0/21
173.194.0.0/16
209.85.128.0/17
216.58.192.0/19
216.239.32.0/19
2001:4860:4000::/36
2404:6800:4000::/36
2607:f8b0:4000::/36
2800:3f0:4000::/36
2a00:1450:4000::/36
2c0f:fb50:4000::/36
172.217.0.0/19
172.217.32.0/20
172.217.128.0/19
172.217.160.0/20
172.217.192.0/19
172.253.56.0/21
172.253.112.0/20
108.177.96.0/19
35.191.0.0/16
130.211.0.0/22
74.114.24.0/21
136.112.0.0/12
172.217.224.0/19
208.81.188.0/22
209.85.218.92/30
209.85.161.92/30
209.85.210.220/30
35.190.247.0/24
64.233.160.0/19
66.102.0.0/20
66.249.80.0/20
72.14.192.0/18
74.125.0.0/16
108.177.8.0/21
173.194.0.0/16
209.85.128.0/17
2a00:1450:4864:20::65c/126
2607:f8b0:4864:20::c5c/126
2607:f8b0:4864:20::45c/126
2001:4860:4000::/36
2404:6800:4000::/36
2607:f8b0:4000::/36
2800:3f0:4000::/36
2a00:1450:4000::/36
2c0f:fb50:4000::/36
216.58.192.0/19
216.239.32.0/19
172.217.0.0/19
172.217.32.0/20
172.217.128.0/19
172.217.160.0/20
172.217.192.0/19
172.253.56.0/21
172.253.112.0/20
108.177.96.0/19
35.191.0.0/16
130.211.0.0/22

@pedro14ha
Copy link

Is possible to know only the ip range for Cloud Storage ?

@jeffmccune
Copy link
Author

@pedro14ha not that I'm aware of

@lord-alfred
Copy link

I've made a Github repo with an daily updates Google Cloud, Amazon AWS and Microsoft Azure IP Ranges:
https://github.com/lord-alfred/ipranges

Thanks to all of you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment