获取方法:
APNIC是管理亚太地区IP地址分配的机构,它有着丰富准确的IP地址分配库,同时这些信息也是对外公开的!下面就让我们看看如何在Linux下获得一些电信运营商的IP地址分配情况:
wget http://ftp.apnic.net/apnic/dbase/tools/ripe-dbase-client-v3.tar.gz
tar xzvf ripe-dbase-client-v3.tar.gz
cd whois-3.1
./configure
make
完成上述编译安装工作后,我们开始获取IP地址段;
中国网通:
./whois3 -h whois.apnic.net -l -i mb MAINT-CNCGROUP > /var/cnc
中国电信:
./whois3 -h whois.apnic.net -l -i mb MAINT-CHINANET > /var/chinanet
中国铁通:
./whois3 -h whois.apnic.net -l -i mb MAINT-CN-CRTC > /var/crtc
打开获取后的文件可以看到里面的信息非常详细,甚至可以看到各个分公司的负责人、电话、电子邮件等等信息。如果想得到一份整齐干净的IP地址段文件,只要用grep和awk简单过滤就可以了。
过滤提取IP段
中国网通:
sed -e '/./{H;$!d;}' -e 'x;/CNCGROUP/!d' /var/cnc | grep 'inetnum' >/var/cnc.txt
中国电信:
sed -e '/./{H;$!d;}' -e 'x;/CHINANET/!d' /var/chinanet | grep 'inetnum' >/var/chinanet.txt
中国铁通:
sed -e '/./{H;$!d;}' -e 'x;/CN-CRTC/!d' /var/crtc | grep 'inetnum' >/var/crtc.txt
其中已经包括了全国电信级网通和铁通IP地址分配段
[广东ip段北京网通ip段,辽宁ip段,网通ip段北京ip段,电信ip段,浙江ip段,湖南ip段,广东电信ip段,浙江电信ip段,中国ip段,山东网通ip段,山东ip段,广州ip段,福建ip段,上海电信ip段,铁通ip段,广西ip段,
太原ip段,辽宁网通ip段,北京电信ip段,adsl ip段,广东省ip段,河北ip段,黑龙江网通ip段,上海ip段,山西ip段,四川ip段,江西ip段,
河北网通ip段,四川电信ip段,广州电信ip段,广西电信ip段,广东电信adsl的ip段,服务器ip段,地区ip段,中国网通ip段,联通ip段,公网ip段,成都ip段,河南ip段,厦门ip段,
大连ip段,贵州ip段,陕西ip段,广州adsl ip段,济南ip段,电信adsl ip段,福州的ip段,河南网通ip段,黑龙江ip段,山东省ip段,四川网通ip段]
我在网上也查了一上,有人提供:(ip段查询器下载,ip段查询软件,ip段扫描器,ip段搜索)不过我觉得不太好因,因为都不是最新的.
国外IP段如[美国ip段,韩国ip段,,日本ip段,最新美国ip段,日本的ip段,]请到http://ftp.apnic.net 上查询
ip route 58.32.0.0 255.248.0.0 172.20.0.250
ip route 58.40.0.0 255.254.0.0 172.20.0.250
ip route 58.42.0.0 255.255.0.0 172.20.0.250
ip route 58.43.0.0 255.255.0.0 172.20.0.250
ip route 58.44.0.0 255.252.0.0 172.20.0.250
ip route 58.48.0.0 255.248.0.0 172.20.0.250
ip route 58.56.0.0 255.254.0.0 172.20.0.250
ip route 58.58.0.0 255.255.0.0 172.20.0.250
ip route 58.59.0.0 255.255.128.0 172.20.0.250
ip route 58.59.128.0 255.255.128.0 172.20.0.250
ip route 58.60.0.0 255.252.0.0 172.20.0.250
ip route 58.208.0.0 255.240.0.0 172.20.0.250
ip route 59.32.0.0 255.248.0.0 172.20.0.250
ip route 59.40.0.0 255.254.0.0 172.20.0.250
ip route 59.42.0.0 255.255.0.0 172.20.0.250
ip route 59.43.0.0 255.255.0.0 172.20.0.250
ip route 59.44.0.0 255.252.0.0 172.20.0.250
ip route 59.48.0.0 255.255.0.0 172.20.0.250
ip route 59.49.0.0 255.255.128.0 172.20.0.250
ip route 59.49.128.0 255.255.128.0 172.20.0.250
ip route 59.50.0.0 255.255.0.0 172.20.0.250
ip route 59.51.0.0 255.255.128.0 172.20.0.250
ip route 59.51.128.0 255.255.128.0 172.20.0.250
ip route 59.52.0.0 255.252.0.0 172.20.0.250
ip route 59.56.0.0 255.252.0.0 172.20.0.250
ip route 59.60.0.0 255.254.0.0 172.20.0.250
ip route 59.62.0.0 255.254.0.0 172.20.0.250
ip route 59.172.0.0 255.254.0.0 172.20.0.250
ip route 60.160.0.0 255.254.0.0 172.20.0.250
ip route 60.162.0.0 255.254.0.0 172.20.0.250
ip route 60.164.0.0 255.254.0.0 172.20.0.250
ip route 60.166.0.0 255.254.0.0 172.20.0.250
ip route 60.168.0.0 255.248.0.0 172.20.0.250
ip route 60.176.0.0 255.240.0.0 172.20.0.250
ip route 60.235.0.0 255.255.0.0 172.20.0.250
ip route 61.128.0.0 255.254.0.0 172.20.0.250
ip route 61.130.0.0 255.254.0.0 172.20.0.250
ip route 61.132.0.0 255.255.0.0 172.20.0.250
ip route 61.133.128.0 255.255.128.0 172.20.0.250
ip route 61.134.0.0 255.255.192.0 172.20.0.250
ip route 61.134.64.0 255.255.224.0 172.20.0.250
ip route 61.136.128.0 255.255.128.0 172.20.0.250
ip route 61.137.0.0 255.255.128.0 172.20.0.250
ip route 61.138.192.0 255.255.192.0 172.20.0.250
ip route 61.139.0.0 255.255.128.0 172.20.0.250
ip route 61.139.192.0 255.255.192.0 172.20.0.250
ip route 61.140.0.0 255.252.0.0 172.20.0.250
ip route 61.144.0.0 255.252.0.0 172.20.0.250
ip route 61.150.0.0 255.254.0.0 172.20.0.250
ip route 61.152.0.0 255.255.0.0 172.20.0.250
ip route 61.153.0.0 255.255.0.0 172.20.0.250
ip route 61.154.0.0 255.254.0.0 172.20.0.250
ip route 61.157.0.0 255.255.0.0 172.20.0.250
ip route 61.159.64.0 255.255.192.0 172.20.0.250
ip route 61.159.128.0 255.255.128.0 172.20.0.250
ip route 61.160.0.0 255.255.0.0 172.20.0.250
ip route 61.161.64.0 255.255.192.0 172.20.0.250
ip route 61.164.0.0 255.255.0.0 172.20.0.250
ip route 61.165.0.0 255.255.0.0 172.20.0.250
ip route 61.166.0.0 255.255.0.0 172.20.0.250
ip route 61.169.0.0 255.255.0.0 172.20.0.250
ip route 61.170.0.0 255.254.0.0 172.20.0.250
ip route 61.172.0.0 255.252.0.0 172.20.0.250
ip route 61.177.0.0 255.255.0.0 172.20.0.250
ip route 61.178.0.0 255.255.0.0 172.20.0.250
ip route 61.180.0.0 255.255.128.0 172.20.0.250
ip route 61.183.0.0 255.255.0.0 172.20.0.250
ip route 61.184.0.0 255.252.0.0 172.20.0.250
ip route 61.188.0.0 255.255.0.0 172.20.0.250
ip route 61.189.128.0 255.255.128.0 172.20.0.250
ip route 61.190.0.0 255.254.0.0 172.20.0.250
ip route 116.1.0.0 255.255.0.0 172.20.0.250
ip route 116.4.0.0 255.252.0.0 172.20.0.250
ip route 116.8.0.0 255.252.0.0 172.20.0.250
ip route 116.16.0.0 255.240.0.0 172.20.0.250
ip route 116.52.0.0 255.252.0.0 172.20.0.250
ip route 116.192.0.0 255.255.0.0 172.20.0.250
ip route 116.224.0.0 255.240.0.0 172.20.0.250
ip route 116.246.0.0 255.254.0.0 172.20.0.250
ip route 116.248.0.0 255.254.0.0 172.20.0.250
ip route 116.252.0.0 255.254.0.0 172.20.0.250
ip route 121.8.0.0 255.248.0.0 172.20.0.250
ip route 121.32.0.0 255.252.0.0 172.20.0.250
ip route 121.56.0.0 255.254.0.0 172.20.0.250
ip route 121.58.0.0 255.255.128.0 172.20.0.250
ip route 121.59.0.0 255.255.0.0 172.20.0.250
ip route 121.60.0.0 255.252.0.0 172.20.0.250
ip route 121.204.0.0 255.252.0.0 172.20.0.250
ip route 121.224.0.0 255.240.0.0 172.20.0.250
ip route 122.4.0.0 255.252.0.0 172.20.0.250
ip route 122.102.80.0 255.255.240.0 172.20.0.250
ip route 122.224.0.0 255.240.0.0 172.20.0.250
ip route 122.240.0.0 255.248.0.0 172.20.0.250
ip route 123.52.0.0 255.252.0.0 172.20.0.250
ip route 123.96.0.0 255.254.0.0 172.20.0.250
ip route 123.101.0.0 255.255.0.0 172.20.0.250
ip route 123.103.0.0 255.255.128 .0 172.20.0.250
ip route 123.149.0.0 255.255.0.0 172.20.0.250
ip route 123.150.0.0 255.254.0.0 172.20.0.250
ip route 123.160.0.0 255.252.0.0 172.20.0.250
ip route 123.164.0.0 255.252.0.0 172.20.0.250
ip route 123.168.0.0 255.252.0.0 172.20.0.250
ip route 123.172.0.0 255.254.0.0 172.20.0.250
ip route 123.174.0.0 255.254.0.0 172.20.0.250
ip route 123.177.0.0 255.255.0.0 172.20.0.250
ip route 123.178.0.0 255.254.0.0 172.20.0.250
ip route 123.180.0.0 255.252.0.0 172.20.0.250
ip route 123.184.0.0 255.252.0.0 172.20.0.250
ip route 123.244.0.0 255.252.0.0 172.20.0.250
ip route 124.72.0.0 255.255.0.0 172.20.0.250
ip route 124.73.0.0 255.255.0.0 172.20.0.250
ip route 124.74.0.0 255.254.0.0 172.20.0.250
ip route 124.76.0.0 255.252.0.0 172.20.0.250
ip route 124.112.0.0 255.254.0.0 172.20.0.250
ip route 124.114.0.0 255.254.0.0 172.20.0.250
ip route 124.116.0.0 255.255.0.0 172.20.0.250
ip route 124.117.0.0 255.255.0.0 172.20.0.250
ip route 124.118.0.0 255.254.0.0 172.20.0.250
ip route 124.224.0.0 255.255.0.0 172.20.0.250
ip route 124.225.0.0 255.255.0.0 172.20.0.250
ip route 124.226.0.0 255.254.0.0 172.20.0.250
ip route 124.228.0.0 255.252.0.0 172.20.0.250
ip route 124.232.0.0 255.254.0.0 172.20.0.250
ip route 124.234.0.0 255.254.0.0 172.20.0.250
ip route 124.236.0.0 255.252.0.0 172.20.0.250
ip route 125.64.0.0 255.248.0.0 172.20.0.250
ip route 125.72.0.0 255.255.0.0 172.20.0.250
ip route 125.73.0.0 255.255.0.0 172.20.0.250
ip route 125.74.0.0 255.254.0.0 172.20.0.250
ip route 125.76.0.0 255.255.128.0 172.20.0.250
ip route 125.76.128.0 255.255.128.0 172.20.0.250
ip route 125.77.0.0 255.255.0.0 172.20.0.250
ip route 125.78.0.0 255.254.0.0 172.20.0.250
ip route 125.80.0.0 255.248.0.0 172.20.0.250
ip route 125.88.0.0 255.248.0.0 172.20.0.250
ip route 125.104.0.0 255.248.0.0 172.20.0.250
ip route 125.112.0.0 255.240.0.0 172.20.0.250
ip route 202.96.96.0 255.255.248.0 172.20.0.250
ip route 202.96.104.0 255.255.248.0 172.20.0.250
ip route 202.96.112.0 255.255.240.0 172.20.0.250
ip route 202.96.128.0 255.255.248.0 172.20.0.250
ip route 202.96.136.0 255.255.248.0 172.20.0.250
ip route 202.96.144.0 255.255.240.0 172.20.0.250
ip route 202.96.160.0 255.255.248.0 172.20.0.250
ip route 202.96.168.0 255.255.248.0 172.20.0.250
ip route 202.96.176.0 255.255.240.0 172.20.0.250
ip route 202.96.192.0 255.255.248.0 172.20.0.250
ip route 202.96.200.0 255.255.248.0 172.20.0.250
ip route 202.96.208.0 255.255.240.0 172.20.0.250
ip route 202.96.224.0 255.255.248.0 172.20.0.250
ip route 202.96.232.0 255.255.248.0 172.20.0.250
ip route 202.96.240.0 255.255.240.0 172.20.0.250
ip route 202.97.0.0 255.255.248.0 172.20.0.250
ip route 202.97.8.0 255.255.248.0 172.20.0.250
ip route 202.97.16.0 255.255.240.0 172.20.0.250
ip route 202.97.32.0 255.255.224.0 172.20.0.250
ip route 202.97.64.0 255.255.224.0 172.20.0.250
ip route 202.97.96.0 255.255.240.0 172.20.0.250
ip route 202.97.112.0 255.255.240.0 172.20.0.250
ip route 202.98.32.0 255.255.248.0 172.20.0.250
ip route 202.98.40.0 255.255.248.0 172.20.0.250
ip route 202.98.48.0 255.255.240.0 172.20.0.250
ip route 202.98.64.0 255.255.224.0 172.20.0.250
ip route 202.98.96.0 255.255.248.0 172.20.0.250
ip route 202.98.104.0 255.255.248.0 172.20.0.250
ip route 202.98.112.0 255.255.240.0 172.20.0.250
ip route 202.98.128.0 255.255.224.0 172.20.0.250
ip route 202.98.160.0 255.255.248.0 172.20.0.250
ip route 202.98.168.0 255.255.248.0 172.20.0.250
ip route 202.98.176.0 255.255.240.0 172.20.0.250
ip route 202.98.192.0 255.255.248.0 172.20.0.250
ip route 202.98.200.0 255.255.248.0 172.20.0.250
ip route 202.98.208.0 255.255.240.0 172.20.0.250
ip route 202.98.224.0 255.255.248.0 172.20.0.250
ip route 202.98.232.0 255.255.248.0 172.20.0.250
ip route 202.98.240.0 255.255.240.0 172.20.0.250
ip route 202.100.0.0 255.255.248.0 172.20.0.250
ip route 202.100.8.0 255.255.248.0 172.20.0.250
ip route 202.100.16.0 255.255.240.0 172.20.0.250
ip route 202.100.32.0 255.255.224.0 172.20.0.250
ip route 202.100.64.0 255.255.248.0 172.20.0.250
ip route 202.100.72.0 255.255.248.0 172.20.0.250
ip route 202.100.80.0 255.255.240.0 172.20.0.250
ip route 202.100.96.0 255.255.248.0 172.20.0.250
ip route 202.100.104.0 255.255.248.0 172.20.0.250
ip route 202.100.112.0 255.255.240.0 172.20.0.250
ip route 202.100.128.0 255.255.248.0 172.20.0.250
ip route 202.100.136.0 255.255.248.0 172.20.0.250
ip route 202.100.144.0 255.255.240.0 172.20.0.250
ip route 202.100.160.0 255.255.248.0 172.20.0.250
ip route 202.100.168.0 255.255.248.0 172.20.0.250
ip route 202.100.176.0 255.255.240.0 172.20.0.250
ip route 202.100.192.0 255.255.248.0 172.20.0.250
ip route 202.100.200.0 255.255.248.0 172.20.0.250
ip route 202.100.208.0 255.255.240.0 172.20.0.250
ip route 202.100.224.0 255.255.224.0 172.20.0.250
ip route 202.101.0.0 255.255.192.0 172.20.0.250
ip route 202.101.64.0 255.255.224.0 172.20.0.250
ip route 202.101.96.0 255.255.224.0 172.20.0.250
ip route 202.101.128.0 255.255.192.0 172.20.0.250
ip route 202.101.224.0 255.255.248.0 172.20.0.250
ip route 202.102.0.0 255.255.224.0 172.20.0.250
ip route 202.102.32.0 255.255.224.0 172.20.0.250
ip route 202.102.64.0 255.255.192.0 172.20.0.250
ip route 202.102.192.0 255.255.248.0 172.20.0.250
ip route 202.102.200.0 255.255.248.0 172.20.0.250
ip route 202.102.208.0 255.255.240.0 172.20.0.250
ip route 202.103.0.0 255.255.248.0 172.20.0.250
ip route 202.103.8.0 255.255.248.0 172.20.0.250
ip route 202.103.16.0 255.255.240.0 172.20.0.250
ip route 202.103.32.0 255.255.224.0 172.20.0.250
ip route 202.103.64.0 255.255.224.0 172.20.0.250
ip route 202.103.96.0 255.255.248.0 172.20.0.250
ip route 202.103.104.0 255.255.248.0 172.20.0.250
ip route 202.103.112.0 255.255.240.0 172.20.0.250
ip route 202.103.128.0 255.255.192.0 172.20.0.250
ip route 202.103.192.0 255.255.224.0 172.20.0.250
ip route 202.103.224.0 255.255.248.0 172.20.0.250
ip route 202.103.232.0 255.255.248.0 172.20.0.250
ip route 202.103.240.0 255.255.240.0 172.20.0.250
ip route 202.104.0.0 255.254.0.0 172.20.0.250
ip route 202.107.128.0 255.255.128.0 172.20.0.250
ip route 202.109.0.0 255.255.0.0 172.20.0.250
ip route 202.110.128.0 255.255.192.0 172.20.0.250
ip route 202.111.0.0 255.255.128.0 172.20.0.250
ip route 202.111.192.0 255.255.192.0 172.20.0.250
ip route 218.0.0.0 255.255.0.0 172.20.0.250
ip route 218.1.0.0 255.255.0.0 172.20.0.250
ip route 218.2.0.0 255.254.0.0 172.20.0.250
ip route 218.4.0.0 255.254.0.0 172.20.0.250
ip route 218.6.0.0 255.255.0.0 172.20.0.250
ip route 218.13.0.0 255.255.0.0 172.20.0.250
ip route 218.14.0.0 255.254.0.0 172.20.0.250
ip route 218.16.0.0 255.252.0.0 172.20.0.250
ip route 218.20.0.0 255.255.0.0 172.20.0.250
ip route 218.21.0.0 255.255.128.0 172.20.0.250
ip route 218.22.0.0 255.254.0.0 172.20.0.250
ip route 218.30.0.0 255.254.0.0 172.20.0.250
ip route 218.62.128.0 255.255.128.0 172.20.0.250
ip route 218.63.0.0 255.255.0.0 172.20.0.250
ip route 218.64.0.0 255.254.0.0 172.20.0.250
ip route 218.66.0.0 255.255.0.0 172.20.0.250
ip route 218.67.0.0 255.255.128 .0 172.20.0.250
ip route 218.70.0.0 255.254.0.0 172.20.0.250
ip route 218.72.0.0 255.252.0.0 172.20.0.250
ip route 218.76.0.0 255.254.0.0 172.20.0.250
ip route 218.78.0.0 255.254.0.0 172.20.0.250
ip route 218.80.0.0 255.252.0.0 172.20.0.250
ip route 218.84.0.0 255.252.0.0 172.20.0.250
ip route 218.88.0.0 255.248.0.0 172.20.0.250
ip route 219.128.0.0 255.240.0.0 172.20.0.250
ip route 219.144.0.0 255.252.0.0 172.20.0.250
ip route 219.148.0.0 255.255.0.0 172.20.0.250
ip route 219.149.0.0 255.255.128 .0 172.20.0.250
ip route 219.149.128.0 255.255.192.0 172.20.0.250
ip route 219.149.192.0 255.255.192.0 172.20.0.250
ip route 219.150.0.0 255.255.224.0 172.20.0.250
ip route 219.150.32.0 255.255.224.0 172.20.0.250
ip route 219.150.64.0 255.255.224.0 172.20.0.250
ip route 219.150.96.0 255.255.240.0 172.20.0.250
ip route 219.150.112.0 255.255.240.0 172.20.0.250
ip route 219.150.128.0 255.255.128.0 172.20.0.250
ip route 219.151.0.0 255.255.224.0 172.20.0.250
ip route 219.151.32.0 255.255.224.0 172.20.0.250
ip route 219.151.64.0 255.255.192.0 172.20.0.250
ip route 219.151.128.0 255.255.128.0 172.20.0.250
ip route 219.152.0.0 255.254.0.0 172.20.0.250
ip route 219.159.64.0 255.255.192.0 172.20.0.250
ip route 219.159.128.0 255.255.128.0 172.20.0.250
ip route 220.160.0.0/11 172.20.0.250
ip route 220.192.0.0 255.254.0.0 172.20.0.250
ip route 220.194.0.0 255.254.0.0 172.20.0.250
ip route 220.196.0.0 255.252.0.0 172.20.0.250
ip route 220.200.0.0 255.248.0.0 172.20.0.250
ip route 221.224.0.0 255.248.0.0 172.20.0.250
ip route 221.232.0.0 255.252.0.0 172.20.0.250
ip route 221.236.0.0 255.254.0.0 172.20.0.250
ip route 221.238.0.0 255.255.0.0 172.20.0.250
ip route 221.239.0.0 255.255.128.0 172.20.0.250
ip route 221.239.128.0 255.255.128.0 172.20.0.250
ip route 222.64.0.0 255.248.0.0 172.20.0.250
ip route 222.72.0.0 255.254.0.0 172.20.0.250
ip route 222.74.0.0 255.255.0.0 172.20.0.250
ip route 222.75.0.0 255.255.0.0 172.20.0.250
ip route 222.76.0.0 255.252.0.0 172.20.0.250
ip route 222.80.0.0 255.254.0.0 172.20.0.250
ip route 222.82.0.0 255.255.0.0 172.20.0.250
ip route 222.83.0.0 255.255.128.0 172.20.0.250
ip route 222.83.128.0 255.255.128.0 172.20.0.250
ip route 222.84.0.0 255.255.0.0 172.20.0.250
ip route 222.85.0.0 255.255.128.0 172.20.0.250
ip route 222.85.128.0 255.255.128.0 172.20.0.250
ip route 222.86.0.0 255.254.0.0 172.20.0.250
ip route 222.88.0.0 255.254.0.0 172.20.0.250
ip route 222.90.0.0 255.254.0.0 172.20.0.250
ip route 222.92.0.0 255.252.0.0 172.20.0.250
ip route 222.168.0.0 255.254.0.0 172.20.0.250
ip route 222.170.0.0 255.254.0.0 172.20.0.250
ip route 222.172.0.0 255.255.128.0 172.20.0.250
ip route 222.172.128.0 255.255.128.0 172.20.0.250
ip route 222.173.0.0 255.255.0.0 172.20.0.250
ip route 222.174.0.0 255.254.0.0 172.20.0.250
ip route 222.176.0.0 255.248.0.0 172.20.0.250
ip route 222.184.0.0 255.248.0.0 172.20.0.250
ip route 222.208.0.0 255.248.0.0 172.20.0.250
ip route 222.216.0.0 255.254.0.0 172.20.0.250
ip route 222.218.0.0 255.255.0.0 172.20.0.250
ip route 222.219.0.0 255.255.0.0 172.20.0.250
ip route 222.220.0.0 255.254.0.0 172.20.0.250
ip route 222.222.0.0 255.254.0.0 172.20.0.250
ip route 222.240.0.0 255.248.0.0 172.20.0.250
转载于:https://blog.51cto.com/wangrj1987/807722