This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
fuss:networking [2017/02/22 18:30] – external edit 127.0.0.1 | fuss:networking [2018/08/03 09:11] – [Determining Open Outbound Ports] office | ||
---|---|---|---|
Line 266: | Line 266: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | |||
+ | ====== Determine ISP Address Blocks ====== | ||
+ | |||
+ | Either starting from a hostname, for instance '' | ||
+ | <code bash> | ||
+ | nslookup tb1060.lon.100tb.com | ||
+ | </ | ||
+ | |||
+ | to determine the IP address, or from the IP address itself (in this case, '' | ||
+ | |||
+ | First, lookup the IP itself to determine which ISP it belongs to: | ||
+ | <code bash> | ||
+ | whois 146.185.28.59 | ||
+ | </ | ||
+ | |||
+ | Then, lookup the Autonomous System (AS) number (an ISP identifier code, if you will) of that ISP: | ||
+ | <code bash> | ||
+ | whois -h whois.radb.net 146.185.28.59 | grep ^origin | ||
+ | </ | ||
+ | |||
+ | which should output: | ||
+ | < | ||
+ | origin: | ||
+ | </ | ||
+ | |||
+ | There may be more AS numbers for small internet providers that are, in turn, customers of a larger network. | ||
+ | |||
+ | To make sure that the IP you are after is part of the AS, lookup the AS itself: | ||
+ | <code bash> | ||
+ | whois AS29302 | ||
+ | </ | ||
+ | |||
+ | and make sure that the ISP is listed. | ||
+ | |||
+ | The final step is to get all known routes for the AS: | ||
+ | <code bash> | ||
+ | whois -h whois.radb.net -- -i origin -T route AS29302 | grep ^route | awk '{ print $2 }' | ||
+ | </ | ||
+ | |||
+ | which should output all IPv4 address blocks allocated to that ISP line-by-line (easy to automate): | ||
+ | <code bash> | ||
+ | 146.185.16.0/ | ||
+ | </ | ||
+ | |||
+ | IPv6 can also be queried in the same way: | ||
+ | <code bash> | ||
+ | whois -h whois.radb.net -- -i origin -T route6 AS29302 | grep ^route | awk '{ print $2 }' | ||
+ | </ | ||
+ | |||
+ | and will yield similar results: | ||
+ | <code bash> | ||
+ | 2a01: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||