大力菠菜

HUANYINGLAIDAOXIANHUAQINGJIDIANSHEBEIYOUXIANGONGSIGUANWANG!

西安华清机电设备有限公司

  1. 自动化系统集成设计生产商
  2. 专注自动化系统15年

QUANGUOZIXUNREXIAN

18066512954

华清机电分享如何同时Ping 1000个IP地址,小技巧节约一整天?

作者:admin 发布日期:2019/5/16 关注次数: 二维码分享

我们知道,想知道一个ip地址是否联通,我们直接可以用ping命令解决,有弱电VIP技术群里朋友问到,如果有10设备,100台设备,1000台设备怎么办?一个个ping过去人都要疯掉了,这种情况在大型网络中我们有可能遇到,那怎么办呢?我们今天来看下。

YI、PILIANGpingWANGDUAN

DUIYUYIGEWANGDUANipDIZHIZHONGDUO,RUGUODANGEJIANCESHIZAIMAFAN,NEIMEWOMENKEYIZHIJIEPILIANGpingWANGDUANJIANCE,NEIGEipDIZHICHULEWENTI,YIMULERAN。

XIANKANDAIMA,ZHIJIEZAIMINGLINGXINGCHUANGKOUSHURU:

for /L %D in (1,1,255) do ping 10.168.1.%D

IPDIZHIDUANXIUGAICHENGNIYAOJIANCHADEIPDIZHIDUAN。


DANGSHURUPILIANGMINGLINGHOU,NEIMETAJIUZIDONGBAWANGDUANNEISUOYOUDEipDIZHIDOUpingWANWEIZHI。

NEIMEZHEIDUAN“for /L %D in(1,1,255) do ping 10.168.1.%D” DAIMASHISHENMEYISINI?

DAIMAZHONGDEZHEIGE(1,1,255)JIUSHIWANGDUANQIYUSHI,JIUSHIJIANCEWANGDUAN192.168.1.1DAO192.168.1.255ZHIJIANDESUOYOUDEipDIZHI,MEICIZHUZENG1,ZHIJIEDAO1DAO255ZHEI255GEipJIANCEWANWEIZHI。

ER、PILIANGpingWANGDUANMINGLINGSHENGJI

SHANGMIANDEMINGLINGSUIRANNENGPILIANGping DIZHI,DANSHISHANGMIANDAIMAZAIMINGLINGXINGCHUANGKOUXIANSHISHULIANGDUODESHIHOUKANQILAIYEHENMAFAN,NEIMEWOMENZAISHENGJIYIXIA,YONGXIAMIANDEDAIMA。

for /L %D in (1,1,255) do ping -n 10.168.1.%D >>a.txt

SHUOMING,ipDIZHISHIBIANDE,NITIANNIXUYAOCEDEipWANGDUANJIUXING,a.txtYESHIBIANDE,KEYIZIYISHEZHIMINGCHENG。

ZHEIYANGJIUHUIBAJIEGUODAORUDEa.txtWENJIANZHONG,QUANBUIPJIANCHAWANCHENGHOUDAKAIa.txtSOUSUO“TTL=”BAOHANTADEJIUSHITONGDEDIZHI,MEIYOUBAOHAN“TTL=”DEDIZHIJIUSHIBUTONGDE。RUXIATU



打开后,就直接搜索没TTL的就可以了。

三、批量ping网段命令再升级

很多人要说了这样还要搜索,也不是太方便,需要这样查来查去,那么我们再看下,是否有更简便的方法呢?

DAANKENDINGSHIYOUDE,WOMENLAIKANDAIMA。

for /l %D in (1,1,255) do (ping 192.168.1.%D -n 1 && echo 192.168.1.%D>>ok.txt || echo 192.168.1.%D >>no.txt)

ZHEIDUANDAIMAHUIJIANGpingTONGDEIPHEBUTONGDEIPFENBIEFANGDAOLIANGGEWENJIANLIMIAN,ZHEIYANGSHIBUSHIHENFANGBIANLA,RUXIATU:

这段代码非常实用,在大网络中可以用到,就是大家在输入的时候需要细心,不过也没有关系,可以直接把这个文章收藏,日后要用,直接复制里面代码,然后改下里面ip地址就行了。

SI、PILIANGpingWANGDUANMINGLINGZHONGJIFANGFA

SHANGMIANTIDAODESANZHONGDAIMATIDAODEDOUSHIZHENDUITONGYIGEWANGDUANNEIipDIZHIPILIANGJIANCE,NEIMEKENDINGZAISHIJIXIANGMUZHONG,YEKENENGCUNBUTONGWANGDUANDEipDIZHIXUYAOTONGSHIJIANCE,NEIMEZENMEBANNI?

也有方法,可以把没有规划的ip地址同时批量检测,我们来看下代码:

for /f %D in (ip.txt) do (ping %D -n 1 && echo %i>>ok.txt || echo %D >>no.txt)

KANJIANMEIYOUDUOLEYIGEip.txtWENJIAN,ZHEIGEWENJIANSHIYAONIZIJIZHUNBEIDEE,BANIpingDEDIZHIXIEDAOZHEIGEWENJIANLIMIAN,DAIMAHUIZIJIDUQUZHEIGEWENJIANLIMIANDEipDIZHI,BINGQIEBAJIEGUOFANGDAOLIANGGEWENJIANLIMIANQU。ZHEILIJIUBUJIDAJIAJIETULEYUSHANGTUCHABUDUO。

ZHEILIMIANBUCHONGXIA:

SHANGMIANDAIMASHENGCHENGDEWENJIANZAINIMINGLINGXINGMORENMULUXIAYEJIUSHISHUORUGUONIDEMINGLINGXINGZHUANGTAISHI"c:\windows\system32>"NEIMESHENGCHENGDEWENJIANJIUZAIXITONGDEsystem32MULUXIAMIAN。RUGUOSHI"c:\"NEIMEWENJIANJIUZAICPANGENMULUXIA。ZHEIGEKEYIGENJUZIJIDESHIJIQINGKUANGJINXINGDIAOZHENG。





DAKAIHOU,JIUZHIJIESOUSUOMEITTLDEJIUKEYILE。

三、批量ping网段命令再升级

很多人要说了这样还要搜索,也不是太方便,需要这样查来查去,那么我们再看下,是否有更简便的方法呢?

DAANKENDINGSHIYOUDE,WOMENLAIKANDAIMA。

for /l %D in (1,1,255) do (ping 192.168.1.%D -n 1 && echo 192.168.1.%D>>ok.txt || echo 192.168.1.%D >>no.txt)

ZHEIDUANDAIMAHUIJIANGpingTONGDEIPHEBUTONGDEIPFENBIEFANGDAOLIANGGEWENJIANLIMIAN,ZHEIYANGSHIBUSHIHENFANGBIANLA,RUXIATU:





ZHEIDUANDAIMAFEICHANGSHIYONG,ZAIDAWANGLUOZHONGKEYIYONGDAO,JIUSHIDAJIAZAISHURUDESHIHOUXUYAOXIXIN,BUGUOYEMEIYOUGUANXI,KEYIZHIJIEBAZHEIGEWENZHANGSHOUZANG,RIHOUYAOYONG,ZHIJIEFUZHILIMIANDAIMA,RANHOUGAIXIALIMIANipDIZHIJIUXINGLE。

SI、PILIANGpingWANGDUANMINGLINGZHONGJIFANGFA

SHANGMIANTIDAODESANZHONGDAIMATIDAODEDOUSHIZHENDUITONGYIGEWANGDUANNEIipDIZHIPILIANGJIANCE,NEIMEKENDINGZAISHIJIXIANGMUZHONG,YEKENENGCUNBUTONGWANGDUANDEipDIZHIXUYAOTONGSHIJIANCE,NEIMEZENMEBANNI?

YEYOUFANGFA,KEYIBAMEIYOUGUIHUADEipDIZHITONGSHIPILIANGJIANCE,WOMENLAIKANXIADAIMA:

for /f %D in (ip.txt) do (ping %D -n 1 && echo %i>>ok.txt || echo %D >>no.txt)

KANJIANMEIYOUDUOLEYIGEip.txtWENJIAN,ZHEIGEWENJIANSHIYAONIZIJIZHUNBEIDEE,BANIpingDEDIZHIXIEDAOZHEIGEWENJIANLIMIAN,DAIMAHUIZIJIDUQUZHEIGEWENJIANLIMIANDEipDIZHI,BINGQIEBAJIEGUOFANGDAOLIANGGEWENJIANLIMIANQU。ZHEILIJIUBUJIDAJIAJIETULEYUSHANGTUCHABUDUO。

ZHEILIMIANBUCHONGXIA:

SHANGMIANDAIMASHENGCHENGDEWENJIANZAINIMINGLINGXINGMORENMULUXIAYEJIUSHISHUORUGUONIDEMINGLINGXINGZHUANGTAISHI"c:\windows\system32>"NEIMESHENGCHENGDEWENJIANJIUZAIXITONGDEsystem32MULUXIAMIAN。RUGUOSHI"c:\"NEIMEWENJIANJIUZAICPANGENMULUXIA。ZHEIGEKEYIGENJUZIJIDESHIJIQINGKUANGJINXINGDIAOZHENG。

【返回列表】

【推荐阅读】↓

【本文标签】:

案例展示

CASE SHOW

快速通道 Express Lane

咨询热线

1806651295418066512954

YOUXIANG:kunzi1956@163.com

QQ:3474293447

版权所有:西安华清机电设备有限公司"/>

备案号:    网站地图 RSS XML  西安|兰州|新疆|内蒙|山西|山东|
联系人:刘经理 电话:18066512954      技术支持: 
地址:西安市碑林区南二环东段云峰大厦  全国服务热线:029-62598277  邮箱:kunzi1956@163.com
西安华清机电设备有限公司主要从事西安控制柜,西安人机界面,西安plc编程,西安情报面板的产品,欢迎前来咨询!

二维码