Skip to content

Instantly share code, notes, and snippets.

@pengelana
Created January 26, 2020 09:58
Show Gist options
  • Save pengelana/7337bef687f5c636231032082b6e2043 to your computer and use it in GitHub Desktop.
Save pengelana/7337bef687f5c636231032082b6e2043 to your computer and use it in GitHub Desktop.
block_amazon
curl -si 'https://ip-ranges.amazonaws.com/ip-ranges.json' | grep 'ip_prefix' | awk '{print $NF}' | sed 's/[",]//g' | xargs -n1 /sbin/ipset add blacklist
curl -si 'https://ip-ranges.amazonaws.com/ip-ranges.json' | grep 'ipv6_prefix' | awk '{print $NF}' | sed 's/[",]//g' | xargs -n1 /sbin/ipset add blacklist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment