从MAC地址获取IP. arp -a不显示设备 [英] Get IP from MAC address. arp -a not showing device

查看:690
本文介绍了从MAC地址获取IP. arp -a不显示设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个批处理文件,该文件应该在Android手机连接到网络(Tenda WiFi路由器)时查找动态分配的IP.

I'm trying to write a batch file that's supposed to find the dynamically assigned IP of my Android phone when it's connected to the network (Tenda WiFi router).

所以我正在尝试arp -a并搜索手机的MAC地址,以便从表中获取其IP.

So I'm trying arp -a and searching for my phone's MAC address so I can get its IP from the table.

C:\Users\Leeroy>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表中时手动进行的操作.

The problem is it doesn't show up in the table! I tried ping 192.168.0.255 but it still doesn't show up. I tried requesting 192.168.0.100 (IP of my desktop PC) from the phone's browser, and that sure enough puts the phone on the radar. But I don't have the option to manually do that everytime I want it to appear in the arp table.

我如何让Android手机出现在arp表中(除了连​​接WiFi外不做任何其他事情)?

How do I get the Android phone to appear in the arp table (without doing anything from it besides connecting to WiFi)?

推荐答案

我已经尝试过了,并且有效:

I have tried this and it works:

for /L %N in (1,1,254) do start /b ping -n 1 -w 200 192.168.0.%N

如果电话已启用ICMP,则应该没有问题.

provided the phone has ICMP enabled, you should have no problem.

这篇关于从MAC地址获取IP. arp -a不显示设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆