1、说明:用于收集终端的网卡IP信息,查看IPv4路由表,解析域名测试,追踪域名路径,查看国内出口IP,查看国外出口IP,测试ping阿里云DNS和谷歌DNS20个包。

2、使用:将以下信息复制到txt文本文档,后缀改成bat格式保存,并以管理员身份运行即可(cmd窗口不要关闭,脚本跑完,自己关闭)。

Snipaste_2023-07-06_15-27-04

Snipaste_2023-07-06_15-27-55

3、结果:去C盘根目录查看log.txt文件就是。

Snipaste_2023-07-06_15-29-16

@echo off
chcp 936 > nul
setlocal

set LOG_FILE=C:\log.txt

break > %LOG_FILE%

ipconfig /all >> %LOG_FILE%
echo. >> %LOG_FILE%

route print -4 >> %LOG_FILE%
echo. >> %LOG_FILE%

ipconfig /flushdns >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

nslookup www.baidu.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

nslookup www.google.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

nslookup www.youtube.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

tracert -d -w 1 www.baidu.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

tracert -d -w 1 www.google.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

tracert -d -w 1 www.youtube.com >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

curl 4.ipw.cn >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

curl ipinfo.io >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

ping -n 20 223.5.5.5 >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

ping -n 20 8.8.8.8  >> %LOG_FILE%
echo. >> %LOG_FILE%
echo =============================================================== >> %LOG_FILE%

endlocal