Created
October 19, 2011 08:52
-
-
Save danbeam/1297765 to your computer and use it in GitHub Desktop.
One-liner to get gmail CIDRs (and add to ufw)
This file contains hidden or 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
dig gmail.com txt | grep redirect= | cut -d'=' -f3- | cut -d'"' -f1 | xargs -I{} dig {} txt | egrep '^[^;].*TXT' | cut -d'"' -f2 | tr " " "\n" | grep ^ip4: | cut -d':' -f2- | xargs -I{} sudo ufw allow from {} to any proto tcp port 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment