Created
August 20, 2018 11:59
-
-
Save jthoenes/4da68f6f723439be954849eb76463adc to your computer and use it in GitHub Desktop.
Create list of AWS IP ranges (ec2, in Frankfurt) for OpenVPN config
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
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