Get IP from MAC address. arp -a not showing device

后端 未结 4 1704
不知归路
不知归路 2021-02-04 06:47

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).

So I

4条回答
  •  耶瑟儿~
    2021-02-04 07:13

    If you want find IP from MAC do this

    $  arp -n | grep -w -i 'YOUR-MAC' | awk '{print $1}'
    

    Note you must replace YOUR-MAC, with your mac address, keep single quotes

    Now, if you want find MAC Address from some IP Try this:

    $  arp -n | grep -w -i 'YOUR-IP' | awk '{print $3}'
    

    Enjoy!

提交回复
热议问题