AWS dynamic IP ranges

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.


What are the dynamic IP ranges used by AWS in Ireland for the EC2 service?

$ curl -s | jq '.prefixes| .[] | select((.region == "eu-west-1") and (.service == "EC2"))|.ip_prefix'|sed 's/"//g'

Wow! How many IPs are we actually talking about?

$ for range in `curl -s | jq '.prefixes| .[] | select((.region == "eu-west-1") and (.service == "EC2"))|.ip_prefix'|sed 's/"//g'`; do ipcalc $range|egrep '^Hosts/Net:'|awk '{print $2}'; done|paste -sd+|bc

Hope it helps!

Leave a Reply

Your email address will not be published. Required fields are marked *