Article Title: easy access to CIDR blocks of China Netcom, China Telecom, and China Tietong. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Sometimes it is necessary to know the IP address segment distribution of Telecom, China Netcom, China Tietong and other telecom operators as accurate as possible for cross-network segment Engineering and Applications. However, there are few materials available on the Internet, in addition, it is often the expiration date of N months ago ......
APNIC is an organization that manages IP address allocation in the Asia Pacific region. it has a rich and accurate IP address allocation library, and this information is also made public to the public! Next let's take a look at how to obtain the IP address distribution of some telecom operators in Linux:
Shell> wget http://ftp.apnic.net/apnic/dbase ...... Se-client-v3.tar.gz shell> tar xzvf ripe-dbase-client-v3.tar.gz shell> cd whois-3.1 shell>./configure shell> make after completing the above compilation and installation, we start to get the IP address segment;
China Netcom: shell>./whois3-h whois.apnic.net-l-I mb MAINT-CNCGROUP>/var/cnc
China Telecom: shell>./whois3-h whois.apnic.net-l-I mb MAINT-CHINANET>/var/chinanet
China Tietong: shell>./whois3-h whois.apnic.net-l-I mb MAINT-CN-CRTC>/var/crtc
When you open the obtained file, you can see that the information in it is very detailed, and even the owner, phone number, email, and other information of each branch. If you want to get a neat and clean IP address segment file, you only need to use grep and awk for simple filtering :)