G
G
grabbee2020-10-07 23:44:58
Network administration
grabbee, 2020-10-07 23:44:58

What is the API for getting information about subnets?

Is there a free API to get subnet information for an address? I found ip-api - they give information on a specific address and the name of the provider. But if it is a provider, such as SDN or data center hosting, then there are a lot of blocks of IP addresses. Here on the site I threw out at one address

Blocks without spaces
23.226.12.0/2437.235.96.0/2437.235.97.0/2437.235.98.0/2437.235.101.0/2437.235.102.0/2437.235.103.0/2437.235.104.0/2437.235.105.0/2437.235.106.0/2437.235.107.0/2437.235.108.0/2437.235.109.0/2437.235.110.0/2437.235.111.0/2445.82.223.0/2445.121.202.0/2445.132.141.0/2445.132.142.0/2445.132.143.0/2445.132.193.0/2445.133.90.0/2445.137.197.0/2445.139.51.0/2446.234.113.0/2484.17.32.0/2484.17.32.0/2384.17.33.0/2484.17.34.0/2484.17.35.0/2484.17.36.0/2484.17.37.0/2484.17.38.0/2384.17.40.0/2484.17.41.0/2484.17.42.0/2384.17.44.0/2384.17.46.0/2384.17.48.0/2384.17.50.0/2384.17.52.0/2384.17.54.0/2384.17.56.0/2384.17.56.0/2484.17.57.0/2484.17.58.0/2384.17.60.0/2384.17.62.0/2484.17.63.0/2489.37.226.0/2489.187.160.0/2389.187.162.0/2389.187.164.0/2489.187.165.0/2489.187.166.0/2389.187.168.0/2489.187.169.0/2489.187.170.0/2389.187.172.0/2389.187.174.0/2489.187.175.0/2489.187.176.0/2289.187.180.0/2289.187.184.0/2289.187.188.0/2295.142.112.0/2495.142.113.0/2495.142.114.0/2495.142.115.0/2495.142.116.0/2495.142.117.0/2495.142.118.0/2495.142.119.0/2495.142.120.0/2495.142.122.0/2495.142.126.0/2495.142.127.0/24103.15.193.0/24104.238.39.0/24143.244.32.0/24143.244.33.0/24143.244.34.0/23143.244.36.0/22143.244.40.0/22143.244.44.0/22143.244.48.0/22143.244.52.0/22143.244.56.0/23143.244.58.0/23143.244.60.0/23143.244.62.0/23154.16.23.0/24154.16.240.0/24156.146.32.0/24156.146.33.0/24156.146.34.0/23156.146.36.0/23156.146.38.0/23156.146.40.0/24156.146.41.0/24156.146.42.0/23156.146.44.0/23156.146.46.0/23156.146.48.0/23156.146.50.0/23156.146.52.0/23156.146.54.0/23156.146.56.0/23156.146.58.0/23156.146.60.0/23156.146.62.0/24156.146.63.0/24159.242.228.0/23159.242.228.0/24181.214.206.0/24185.59.220.0/24185.59.221.0/24185.59.222.0/24185.59.223.0/24185.76.8.0/24185.76.9.0/24185.76.10.0/24185.76.11.0/24185.93.0.0/24185.93.1.0/24185.93.2.0/24185.93.3.0/24185.102.216.0/24185.102.217.0/24185.102.218.0/24185.102.219.0/24185.152.64.0/23185.152.66.0/24185.152.67.0/24185.172.58.0/24185.180.12.0/24185.180.13.0/24185.180.14.0/23185.203.85.0/24185.229.188.0/23185.229.188.0/24185.229.189.0/24185.229.190.0/23185.238.216.0/24185.246.208.0/24185.246.209.0/24185.246.210.0/24185.246.211.0/24191.96.94.0/24195.181.160.0/23195.181.162.0/23195.181.164.0/23195.181.166.0/24195.181.167.0/24195.181.168.0/24195.181.168.0/23195.181.170.0/24195.181.171.0/24195.181.172.0/23195.181.173.0/24195.181.174.0/23209.209.228.0/24209.209.253.0/24209.209.254.0/24212.102.32.0/24212.102.33.0/24212.102.34.0/23212.102.36.0/23212.102.38.0/23212.102.40.0/23212.102.42.0/23212.102.44.0/23212.102.46.0/23212.102.48.0/23212.102.50.0/23212.102.50.0/24212.102.52.0/23212.102.54.0/23212.102.56.0/23212.102.58.0/23212.102.60.0/23212.102.62.0/24212.102.63.0/24

I would like to receive such information by request from the server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Barbolin, 2020-10-08
@dronmaxman

Try this. This is a script by name (DNS) that can pull out all AS addresses. Converting to IP is not difficult.

#!/bin/bash

addr=`nslookup $1  | grep -A 3 Non-authoritative | grep Address: | awk '{print$2}'`
echo $addr

origin=`whois -h whois.radb.net $addr | grep origin | awk '{print$2}'`
echo $origin

origin_quare="whois -h whois.radb.net '!g$origin' | grep /"
echo $origin_quare;

echo "#$1"
addrpool=`whois -h whois.radb.net "!g$origin" | grep /`

for word in $addrpool; do
echo "$word"
done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question