Skip to content

Instantly share code, notes, and snippets.

@jthoenes
Created August 20, 2018 11:59
Show Gist options
  • Save jthoenes/4da68f6f723439be954849eb76463adc to your computer and use it in GitHub Desktop.
Save jthoenes/4da68f6f723439be954849eb76463adc to your computer and use it in GitHub Desktop.
Create list of AWS IP ranges (ec2, in Frankfurt) for OpenVPN config
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="EC2") | select(.region=="eu-central-1") | .ip_prefix' | xargs -I {} ipcalc -nb {} | awk 'BEGIN {RS="";FS="\n"}{print $1, $2}' | awk '{print "route", $2, $4, "vpn_gateway"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment