Get the App
SLTechnology News&Howtos  ›  Development  › 

How to extract ip information from apnic

Shulou Source: shulou.com Published: 2022-06-03 11:28:36 11月15日 Update

This article mainly introduces "how to extract ip information from apnic". In daily operation, I believe many people have doubts about how to extract ip information from apnic. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to extract ip information from apnic". Next, please follow the editor to study!

The code is as follows:

#! / bin/bash# download from apnicrm-f delegated-apnic-latestwget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest# IPs allocated to china.grep 'apnic | CN | ipv4 |' delegated-apnic-latest | cut-f 4-d' |'> delegated-apnic-CN# get detail of echo IP from apnic database.rm-f apnic_CN.txtwhile read ipdo # query apnic database echo "query whois $ip" whois-h whois.apnic.net $ip > tmp.txt grep Inetnum tmp.txt > > apnic_CN.txt # IP range grep netname tmp.txt > > apnic_CN.txt # netname which include sp information grep descr tmp.txt > > apnic_CN.txt # description which include province information echo "" > > apnic_CN.txt done < delegated-apnic-CN# clean uprm-f tmp.txtrm-f delegated-apnic-latestrm-f delegated-apnic-CN so far The study on "how to extract ip information from apnic" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Information learning more help practical next code articles methods theories knowledge articles websites materials follow questions easy to use practice solutions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker Shulou Tech Info OPPO Reno MariaDB