Try this first: arp -a | grep -E -ignore-case 'b8:27:eb|dc:a6:32' Still, I used it many times and it's a simple solution It's not bullet-proof, it will not work if the subnet it starts scanning is not the correct one.Sadly, I cannot find the original contributor. I am not the author of the original script, I just adapted it a little bit to work with a Raspberry Pi.:: Loop through arp table entries and look for Raspberry Pi's MAC addressįor /f "tokens=1" %%f in ('arp -a ^| findstr b8-27-eb') do (set raspIp=%%f)įor /L %%N in (1,1,254) do start /b ping -n 1 -w 200 %subnet%.%%N >nulĮcho Found Raspberry PI with IP: %raspIp%
Java file to show mac address of raspberry pi windows#
:: This script, run from a Windows (10) machine, finds a Raspberry Pi on local networkįor /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set myip=%%bįor /l %%a in (1,1,31) do if NOT "!subnet:~-1!"="." set subnet=!subnet:~0,-1! It is mostly based on the "arp -a" command, but it saves you some extra digging and helps you when your Raspberry is not already in the Arp table.Ĭreate a text file with the following content and rename it as find_raspberry_pi.bat off If you are on Windows I suggest you to try out this script. (To confirm if a Pi has Power Management enabled, ssh to the Pi and run: /sbin/iwconfig wlan0|grep Management) In that case, repeat the scans look for differences. Power Management may be a problem for you if you are scanning for multiple Pis on a LAN, as repeat scans might detect one Pi but not another. A Pi which has networking Power Management:on might not always respond to a scan. Because nmap is continually updated, it contains internal tables of Raspberry Pi MAC addresses (or uses other criteria to detect) and we can assume that will continue working.ĬAVEAT: If your scan does not identify all Pis you know are on the network, then repeat the scan - up to 10 times. The main difference above: we don't assume a MAC pattern, we just grep for the (summary), as this label is provided by nmap itself. MAC Address: DC:A6:32:1B:35:6A (Raspberry Pi Trading) Here is something that's more future-proof. I could just add the "new" MAC as a comment, but the string could change again and again each model. In 2020, the accepted answer does not work anymore because the Raspberry Pi ships with a different range of MAC addresses.