|
dato
高级用户
积分 916
发帖 377
注册 2004-3-8
状态 离线
|
『楼 主』:
如何根据相应的关键字生成网通电信路由表
linux下自动获取网通电信路由表
http://www.hebaodans.com/index.php/2010/04/l-i-n-u-x-xia-zi-dong-huo-qu-wang-tong-dian-xin-lu-you-biao/
上面的这篇是linux下生成的方法,比对了网上已经生成的路由表还是根据http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
这个地址的IP地址来生成数据量比较多一点,
但是似乎它的查询方法已经失效
whois $ip@whois.apnic.net
好不容易搜到个whosip
http://www.nirsoft.net/utils/whosip.html
就想能不能用windows来处理
get_cn_ipv4.cmd
del aa.txt /q
wget -c -O aa.txt "http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest"
del b.txt /q
for /f "tokens=1,* delims=|" %%a in ('type aa.txt^|findstr "CN|ipv4"') do (
for /f "tokens=3,4 delims=|" %%i in ("%%b") do (echo %%i %%j>>b.txt)
) 在线进行查询然后再根据像unicom chinanet之类的关键词进行分类,哈哈实在写不下去了,find findstr也不知道怎么用,怎么也达不到自己想要的效果,大家帮忙看看
setlocal enabledelayedexpansion
for /f "tokens=1,* delims= " %%i in (b.txt) do (
for /f "eol=O tokens=1,* delims=:" %%a in ('whosip %%i^|findstr "Network"') do (
set aa="%%b"
echo %%b>a.txt
find "UNICOM" a.txt | echo %%i %%j>>unicom.txt
)
)
endlocal
|
http://dato.ys168.com
google search bot
http://dato.minidns.net/ |
|
2010-4-22 02:44 |
|
|
dato
高级用户
积分 916
发帖 377
注册 2004-3-8
状态 离线
|
『第
2 楼』:
whosip.cmd
setlocal enabledelayedexpansion
for /f "tokens=1,* delims= " %%i in (b.txt) do (
for /f "eol=O tokens=1,* delims=:" %%a in ('whosip %%i^|findstr "Network"') do (
echo %%i %%j %%b>>all.txt
)
)
endlocal build.cmd
for %%i in (unicom,chinanet,cncgroup,crtc,cernet,cstnet,gwbn,chinabtn,colnet) do (del %%i.txt /q)
::联通
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "UNICOM"') do (
echo %%a %%b>>UNICOM.txt
)
::电信
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CHINANET"') do (
echo %%a %%b>>CHINANET.txt
)
::网通
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CNCGROUP"') do (
echo %%a %%b>>CNCGROUP.txt
)
::铁通
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CRTC"') do (
echo %%a %%b>>CRTC.txt
)
::教育网
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CERNET"') do (
echo %%a %%b>>CERNET.txt
)
::中国科学网
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CSTNET"') do (
echo %%a %%b>>CSTNET.txt
)
::长宽
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "GWBN"') do (
echo %%a %%b>>GWBN.txt
)
::广电
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "CHINABTN"') do (
echo %%a %%b>>CHINABTN.txt
)
::有线通
for /f "tokens=1,2,* delims= " %%a in ('type all.txt^|findstr "COLNET"') do (
echo %%a %%b>>COLNET.txt
)
|
http://dato.ys168.com
google search bot
http://dato.minidns.net/ |
|
2010-4-22 17:16 |
|
|
dato
高级用户
积分 916
发帖 377
注册 2004-3-8
状态 离线
|
『第
3 楼』:
get_cn_ipv4.cmd
del apnic_all.txt /q
wget -c -O apnic_all.txt "http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest"
del cn_ipv4.txt /q
for /f "tokens=1,* delims=|" %%a in ('type apnic_all.txt^|findstr "CN|ipv4"') do (
for /f "tokens=3,4 delims=|" %%i in ("%%b") do (echo %%i %%j>>cn_ipv4.txt)
) whosip_all.cmd
http://www.nirsoft.net/utils/whosip.html
setlocal enabledelayedexpansion
for /f "tokens=1,* delims= " %%i in (cn_ipv4.txt) do (
for /f "tokens=1,* delims=:" %%a in ('start /B /low /wait whosip -r %%i^|findstr "mnt-by:"') do set "maint=%%b"
echo %%i %%j !maint!>>whosip_cn_all.txt
)
endlocal build.cmd
for %%i in (unicom,chinanet,cncgroup,crtc,cernet,cstnet,gwbn,chinabtn,colnet) do (del %%i.txt
/q)
::联通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "UNICOM"') do (
echo %%a %%b>>UNICOM.txt
)
::电信
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CHINANET"') do (
echo %%a %%b>>CHINANET.txt
)
::网通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CNCGROUP"') do (
echo %%a %%b>>CNCGROUP.txt
)
::铁通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CRTC"') do (
echo %%a %%b>>CRTC.txt
)
::教育网
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CERNET"') do (
echo %%a %%b>>CERNET.txt
)
::中国科学网
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CSTNET"') do (
echo %%a %%b>>CSTNET.txt
)
::长宽
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "GWBN"') do (
echo %%a %%b>>GWBN.txt
)
::广电
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "CHINABTN"') do (
echo %%a %%b>>CHINABTN.txt
)
::有线通
for /f "tokens=1,2,* delims= " %%a in ('type whosip_cn_all.txt^|findstr "COLNET"') do (
echo %%a %%b>>COLNET.txt
)
|
http://dato.ys168.com
google search bot
http://dato.minidns.net/ |
|
2010-5-13 11:51 |
|
|