User Tools

Site Tools


google_ip_range

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
google_ip_range [2018/08/25 20:19]
kyxap [Получение диапазона IP адресов Google]
google_ip_range [2020/05/25 23:14] (current)
kyxap add amazon and github
Line 1: Line 1:
 {{tag>​google ip}} {{tag>​google ip}}
-====== Получение диапазона IP адресов ​Google ​======+====== Получение диапазона IP адресов ====== 
 +==== Prerequisites ==== 
 +<code bash> 
 +apt-get install jq netmask moreutils 
 +</​code>​ 
 +<code bash> 
 +wget -P ~/tmp https://​gist.githubusercontent.com/​kyxap1/​5233d86a9649f142e0c894598d4d60b0/​raw/​b369cf61cea3f20cce96244c33e55a6da0c92b89/​aggregate-cidr-addresses.pl 
 +chmod +x ~/​tmp/​aggregate-cidr-addresses.pl 
 +</​code>​
  
 +==== Google ====
 <code bash> <code bash>
 dig +short TXT _spf.google.com \ dig +short TXT _spf.google.com \
Line 9: Line 18:
   | xargs netmask -s \   | xargs netmask -s \
   | perl -pne '​s#​(.+)/​(.+)#​route \1 \2 vpn_gateway#'​   | perl -pne '​s#​(.+)/​(.+)#​route \1 \2 vpn_gateway#'​
 +</​code>​
 +
 +==== Amazon ====
 +<code bash>
 +wget https://​ip-ranges.amazonaws.com/​ip-ranges.json -O - \
 +  | jq -r "​.prefixes[].ip_prefix"​ \
 +  | ./​tmp/​aggregate-cidr-addresses.pl \
 +  | sort -V
 +</​code>​
 +
 +==== Github ====
 +<code bash>
 +wget -O - https://​api.github.com/​meta \
 +  | jq -r "​.hooks,​ .web, .api, .git, .pages, .importer | .[]" \
 +  | ./​tmp/​aggregate-cidr-addresses.pl \
 +  | sort -V
 </​code>​ </​code>​
google_ip_range.1535228343.txt.gz · Last modified: 2018/08/25 20:19 by kyxap