I need to find the Raspberry PI IP address on local network without connect the Raspberry to a monitor. How do I do it on Linux or Mac OS systems?

15 Answers 15

up vote 67 down vote accepted

All raspberry devices MAC addresses started with B8:27:EB.

So, on *nix systems, this can be accomplished by executing the following command:

sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

where 192.168.1.* will be your local network mask. You will get an answer like:

Nmap scan report for raspberrypi.localnetwork.lan (192.168.1.179)

The 192.168.1.179 is the Raspberry Pi IP address on you network.

If you are on a Mac system you can use Homebrew to install nmap:

brew install nmap

On Windows, you might use Wireshark and use the following display filter:

eth.addr[0:3] == B8:27:EB
  • 2
    Or with less pipes: nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' – ripat Feb 26 '14 at 12:08
  • 1
    Thanks @ripat, that is a lot more concise - updated! One little detail, you need to run as administrator or the nmap will not display the MAC address. – J. Costa Feb 26 '14 at 15:13
  • 3
    You would not appreciate the importance of this answer until you have tried to headlessly locate your raspberrypi in an office setting where IP's are dished out using DHCP. Cheers for this @ripat – Voke Ransom Anighoro Apr 17 '14 at 11:53
  • This answer didn't work for me since nmap wasn't spitting out the hostnames for me. However, it did inspire me to search for open ssh ports with nmap and that did enable me to find the pi: sudo nmap -p 22 --open -sV 192.168.0.0/24 per this guy's post. – Ross Rogers Jul 8 '15 at 17:06
  • isn't "sudo nmap -sP 192.168.1.0/24" enough (it wored for me)? – Marian Paździoch Dec 14 '15 at 10:54

If you're running MacOS or Linux, try this one:

$ arp -na | grep -i b8:27:eb

On windows, you can use:

arp -a | findstr b8-27-eb
  • 3
    This solution is much faster than an nmap solution! – ryanm Dec 29 '15 at 3:49
  • This solution worked for me, unlike the nmap solution which gave only part of the list. – Wilbert Feb 15 '16 at 7:42
  • 3
    This will only show hosts which have made it into your arp tables, so sometimes misses the quiet ones. It might help to do an nmap scan once first. – Joseph Sheedy Mar 10 '16 at 0:36
  • It might, but for me this never failed. Plus it's an easy first try. – amenthes Feb 9 at 10:44
  • Thanks for this. I modified it slightly and use arp -n | awk '/b8:27:eb/ {print $1}' now. – 0x01 Apr 6 at 12:02

I use mDNS/Bonjour to give my Pi a local name like pi.local. I dont need to know it's IP address and this works for shortcuts and when you need to embed a link...

How and Why to assign a local name to your Pi

  • Awesome! I used to fiddle around with /etc/hosts locally to get this functionality on my desktop, this is a MUCH better solution! Thanks so much for the pointer! – 0x01 Apr 6 at 12:10

By default the raspberry's name is raspberrypi. You can just 'ping raspberrypi' and the ICMP echo reply gives you the IP address. It worked for me. Make sure though the DHCP server is reachable as the raspberry's NIC is by default in DHCP client mode. Otherwise the raspberry gets an APIPA address.

If you want to use a GUI application for it, you can use Yakala tool (https://github.com/mozcelikors/yakala) for Debian/Ubuntu. This tool helps you not only search for available Type B and Type C networks, but also helps you to directly SSH into the network:

sudo add-apt-repository ppa:mozcelikors/yakala
sudo apt-get update
sudo apt-get install yakala

or

git clone https://github.com/mozcelikors/yakala
cd yakala && sudo ./install.sh

https://raw.githubusercontent.com/mozcelikors/yakala/master/docs/img/peekx2.gif

Disclaimer: I am the creator of Yakala. Any suggestions/bugs are taken very seriously.

  • Classful networking was abandoned in 1993, which is a very long time ago. – Lightness Races in Orbit Mar 26 at 17:28

In linux and MAC, you can also type in "arp - a" in the terminal and you can get a list of connected devices, look for the one with B8 in it, example: 192.168.4.5 @ B8... will be the raspberry pi IP.

Or you could access to your Router via browser and find your android device -almost every router GUI has a service where you can check all devices that are currently connected to your network.

If you run MacOS, use PiFinder, it is an application that will tell you the IP of a Raspberry Pi on your network.

I use the free Fing app in my android smartphone. It scans the network and shows the connected devices by type, including Raspberry Pi, as well as scanning available ports. Handy to see if SSH, web or VNC are enabled and running.

I assume you cannot connect to you PI, otherwise you'd know its IP.

If you go to your router page (usually something like 192.168.1.1 in your browser) there you should have a section with the already connected devices. You can try to plug and unplug the PI (and one device should appear / dissapear from the list)

Copy the following into your Terminal/Console/Shell:

for i in $(jot - 1 254); do ping -t 1 192.168.1.$i && arp -a | cut -f 2,4 -d " " | tr [:lower:] [:upper:] | grep B8:27:EB; done

Please adapt 192.168.1. to your individual network.

The output will look something like this:

(192.168.1.109) B8:27:EE:DD:CC:A

192.168.1.109 would be your Raspberry Pi's IP… :)

Put this in pi.php on your web server:

<?php
$fp = fopen('pi', 'w');
fwrite($fp, $_REQUEST['ip'],1000);
fclose($fp);
?>

You may have to create the file pi on your web server with write permissions for your web server.

Put

curl http://yourwebserver/pi.php -d ip=`hostname -I`

in /etc/rc.local on your pi.

Get the IP of your pi by browsing http://yourwebserver/pi

When using a fresh install of NOOBS or Raspbian, the default hostname is "raspberrypi" and in some network configurations (i.e. if mDNS is in use and configured) you could use "raspberrypi.local". Another option is to run arp -a and look for raspberrypi

NOTE: This won't work for every instance.

  • That answer seems to mix up several things: different IP versions, DNS, and maybe mDNS. Whether .local can be used usually doesn't depend on IPv6, and also not on having a router present. When mDNS support is available then pi-name.local resolves, IPv6 or not. Some home routers also use .local as their local DNS domain, again this is independent of IPv6 and depends on the router model. Some home routers use different domains, such as pi-name.fritz.box. – TheDiveO Feb 18 at 23:35

My router assigns newly discovered systems an ip-address starting at 192.168.1.2, sequentially. I went through every system in my home one day and reserved addresses for them.

That way when I create a new system, chances are that its ip-address will be 192.169.1.18.

Another way to use the serial console. You can use a serial terminal program in order to log into your raspberry pi. I would suggest using the 8N1 (8-bits, no parity bit, 1 stop bit) setting with a speed (baud rate) of 115,200. You'll need a USB to serial (3V3) connector.

'Fing' or 'Net Analyzer' on Android. Shows your whole network.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.