来源网上
各位大佬看看还有什么改进空间吗??
curl ‘http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest’ | grep ipv4 | grep CN | awk -F\| ‘{ printf(“%s/%d\n”, $4, 32-log($5)/log(2)) }’ > IPV4.txt curl ‘http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest’ | grep ipv6 | grep CN | awk -F\| ‘{ printf(“%s/%d\n”, $4, 32-log($5)/log(2)) }’ > IPV6.txt复制代码
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)}’ | cat > ipv4.txt cat delegated-apnic-latest | awk -F ‘|’ ‘/CN/&&/ipv6/ {print $4 “/” 32-log($5)/log(2)}’ | cat > ipv6.txt复制代码
台湾省网友说:1. IP 地址可以广播,APNIC 的更别说;
2. 建议 https://github.com/v2fly/geoip
江西省网友说:最优方案
陕西省网友说:这是怎么做到的?