Last active
February 24, 2020 14:40
-
-
Save pdfcrowd/2d0f45f5d8c0dbd0469180d3f88e1410 to your computer and use it in GitHub Desktop.
Output Google Cloud IP ranges
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dig @8.8.8.8 +short txt _cloud-netblocks.googleusercontent.com | \ | |
sed 's/"//g; s/ip4://g; s/ip6://g;' | \ | |
tr ' ' '\n' | \ | |
grep include | cut -d ':' -f2 | \ | |
xargs dig @8.8.8.8 +short txt | \ | |
sed 's/"//g; s/ip4://g; s/ip6://g;' | tr ' ' '\n' | grep '/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment