转自: https://wjianz.wordpress.com/2014/09/12/howto-%E4%BB%8Eapnic%E8%8E%B7%E5%8F%96%E4%B8%AD%E5%9B%BDip%E5%9C%B0%E5%9D%80%E5%88%97%E8%A1%A8/

VPS购买地址

apnic|CN|ipv4|1.2.2.0|256|20110331|assigned

等级机构|获得该IP段的国家/组织|资源类型|起始IP|IP段长度|分配日期|分配状态

#!/bin/bash
wget -c http://ftp.apnic.net/stats/apnic/delegated-apnic-latest
cat delegated-apnic-latest | awk -F '|' '/CN/&&/ipv4/ {print $4 "/" 32-log($5)/log(2)}' | tee /home/chen/chinaiplist.txt
04-30 22:50