windows – 从MAC地址获取IP. arp -a没有显示设备
发布时间:2020-12-14 04:05:14 所属栏目:Windows 来源:网络整理
导读:我正在尝试编写一个批处理文件,当它连接到网络(Tenda WiFi路由器)时,应该找到我的 Android手机动态分配的IP. 所以我正在尝试使用arp -a并搜索我手机的MAC地址,以便从表中获取IP. C:UsersLeeroyarp -aInterface: 192.168.0.100 --- 0xb Internet Address Ph
我正在尝试编写一个批处理文件,当它连接到网络(Tenda WiFi路由器)时,应该找到我的
Android手机动态分配的IP.
所以我正在尝试使用arp -a并搜索我手机的MAC地址,以便从表中获取IP. C:UsersLeeroy>arp -a Interface: 192.168.0.100 --- 0xb Internet Address Physical Address Type 192.168.0.1 c8-3a-35-35-f6-68 dynamic 192.168.0.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 224.0.0.251 01-00-5e-00-00-fb static 224.0.0.252 01-00-5e-00-00-fc static 239.255.255.250 01-00-5e-7f-ff-fa static 255.255.255.255 ff-ff-ff-ff-ff-ff static 问题是它没有出现在表中!我试过ping 192.168.0.255,但它仍然没有出现.我尝试从手机的浏览器请求192.168.0.100(我的桌面电脑的IP),这确实足以让手机上雷.但是每次我希望它出现在arp表中时,我都没有选择手动执行此操作. 如何让Android手机出现在arp表中(除了连??接到WiFi之外没有做任何事情)? 解决:解决ping.它不会超过一两秒钟. @echo off :top :: Loop through arp table entries and look for my Android device's MAC address for /f "tokens=1-5 skip=3" %%f in ('arp -a') do (if "%%g"=="xx-xx-xx-xx-xx-xx" set ip=%%f) if "%ip%"=="" ( echo Discovering network... :: Ping all IPs from 192.168.0.1 to 254 for /L %%N in (1,1,254) do start /b ping -n 1 -w 200 192.168.0.%%N >nul timeout 1 >nul goto :top ) else ( echo Mapping network location to drive K net use k: http://%ip%:8080 /user:francis underwood /persistent:no if exist k: explorer k: :: Using FTP (please configure user and pass) :: explorer ftp://user:pass@%%f:6262 ) )
我试过这个并且它有效:
for /L %N in (1,254) do start /b ping -n 1 -w 200 192.168.0.%N 如果手机启用了ICMP,您应该没有问题. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- Windows上的Hudson错误:java.io.IOException:无
- active-directory – 是否有一种更简单的方法可以
- windows-server-2003 – 无法删除Windows 2003 S
- windows – 如何在每天的某个时间自动打开网站
- Windows 7 – 在Windows 7上设置与启动/ AFFINIT
- .net – 我应该在IIS中托管我的WCF服务吗?
- windows-7 – 在Windows 7的任务栏上固定广告快捷
- 是否有针对Windows分发本机C库的最佳实践指南?
- Windows配置基础环境(jdk+tomcat)
- Windows是否支持每个文件的元数据?
热点阅读