I have a Raspberry Pi connected to Ethernet and with a Mac (though USB cable).

I'm trying to SSH in the Pi but I don't know the IP address. I have tried :


but I have I can't see eth0

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet netmask 0xff000000 
    inet6 ::1 prefixlen 128 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
        ether a8:20:66:09:f8:36 
    media: autoselect (none)
    status: inactive
    ether 7c:d1:c3:d8:b5:dd 
    inet6 fe80::7ed1:c3ff:fed8:b5dd%en1 prefixlen 64 scopeid 0x5 
    inet netmask 0xffffff00 broadcast
        media: autoselect
    status: active
        lladdr 00:3e:e1:ff:fe:7f:a0:82 
    media: autoselect <full-duplex>
    status: inactive
    ether 0e:d1:c3:d8:b5:dd 
    media: autoselect
        status: inactive

12 Answers 12


In your edited question, it appears the IP is listed under en0 as, assuming that your ifconfig output is coming from the RPi.

  • Con gusto :) And fwiw, the other utilities Pi Filler and Pi Copier are pretty useful, too.
    – einnocent
    Commented Dec 23, 2013 at 20:14

You can lookup the IP address by hostname. Assuming the hostname of your Pi is "raspberrypi"

Here is how you obtain the IP address using ping command and hostname.

From Linux: ping raspberrypi
From Windows: ping raspberrypi
From OS X: ping raspberrypi.local

In order for the command to work from Windows, you need to have Samba running on your Pi. You can install Samba using the command sudo apt-get install samba.

  • 3
    Using samba on a RPi just to broadcast its hostname is like killing a fly with a sledgehammer. Better use avahi. thomasloughlin.com/…
    – ripat
    Commented Feb 26, 2014 at 12:18
  • Some people want the easiest solution. Some people want the most efficient solution. For those looking for an easy solution, it cannot get easier than the one line command to install samba. Plus the avahi solution that you suggested works easily only from OS X. If you want to make it work from Windows, you need Bonjour which you get by installing iTunes. So you are basically replacing the samba sledgehammer with the iTunes sledgehammer.
    – geoji
    Commented Feb 26, 2014 at 16:24
  • Though I think the number of people who have iTunes installed because they need it anyways for their iDevice is greater than the number of people with Samba. @geoji
    – 11684
    Commented Feb 27, 2014 at 7:39
  • You don't need to install samba on the client machine. Samba needs to be installed just once on the raspberry Pi. The downside of the iTunes approach is that you need to have it installed on every single machine from which you need to find the IP address from.
    – geoji
    Commented Feb 27, 2014 at 18:46
  • 1
    ping raspberrypi.local works on windows in the web browser and for ssh on a new raspbian system out of the box with a ssh file in boot. both samba and itunes are unnecessary. Commented Aug 26, 2019 at 12:21

Are the Pi and the Mac in the same network? In that case, I just used arp -a to find it. There's a number of other methods though, listed here: https://apple.stackexchange.com/questions/19783/how-do-i-know-the-ip-addresses-of-other-computers-in-my-network?rq=1

  • 3
    arp -a will work if, and only if, the Mac already successfully probed or connected to a host. Try yourself by restarting your Mac and displaying the arp table. It will be almost empty. To populate that table you need to run something like a ping scan: nmap -sP
    – ripat
    Commented Feb 26, 2014 at 14:07
  • @ripat Wow, that renders it almost useless.
    – 11684
    Commented Feb 27, 2014 at 7:36
  • 1
    Workaround: nmap -sP | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' see my comment on this thread
    – ripat
    Commented Feb 27, 2014 at 8:11
  • ... and you need to run that above command as root sudo nmap .....
    – ripat
    Commented Feb 27, 2014 at 8:29

I developed a cross-platform tool for finding local IP address of Raspberry Pi faster:

The article about it: Pi-oi: a Tool for Finding the Local IP Address of Your Raspberry Pi

  • Super! Works great! Commented Oct 13, 2016 at 9:52
  • Tested. Observed: Wrongly recognized Orange Pi as Pi! However could not recognize Raspbian on Rpi 0 & Rpi 2 even when Host response shows Raspbian. Commented Jul 24, 2017 at 12:33
  • Can you paste a shot screen?
    – Tho
    Commented Jul 24, 2017 at 12:39

Using ping and arp wouldn't work for me, because on my network, the raspberry has been assigned a different hostname.

But I succeeded using lsleases, this is also recommended on the Raspberry PI site.

After installing lsleases, start the server with sudo lsleases -s; then reboot your Raspberry PI and wait for the IP address to appear.

$ sudo lsleases -s
[sudo] password for sebastian: 
2015/01/15 15:36:40 startup -  version:  1.4.0
2015/01/15 15:36:40 enable active check - ping every: 15m

# Reboot your Raspberry PI and wait

2015/01/15 15:37:10 new DHCP Lease: '  b8:27:eb:f5:c3:4a raspberrypi'


  • IMO best answer, fastest and 100% work guarantee. Commented Jan 17, 2021 at 12:36

'en1' is your ethernet address using 'ifconfig'. But you don't need to look up IP addresses - that's what Hostnames and DNS are for. You say you're on a mac, so just 'ssh [email protected]'. Let DNS do the work in the background. If you had given your PI a hostname, say, 'papagoose', and you have a username of 'mama', type 'ssh [email protected]'. If you are secure shelling from a windows OS, just drop the '.local'.


If it's your home network, you can easily login to your router as most of them display client IP addresses somewhere in there. Your router IP can be found by typing ipconfig (Windows) or ifconfig (Mac, Linux, etc.) and it will be listed under Gateway. The router IP is commonly


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


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


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


For me arp works perfectly most of the times if you mac and raspberry are in the same network.

arp -na | grep b8:27

or you can use nmap (Change CIDR with yours)

nmap -sn


  • Using arp and nmap was already said in previous answers. It doesn't help just repeating answers.
    – Ingo
    Commented Mar 4, 2019 at 16:32

It's actually quite simple. Once your pi is connected to wifi, you can just use [email protected]. For the default settings, your command would be the following:

ssh [email protected]

Update: It actually works for other OS's, I think.

  • 1
    This should be the accepted answer! Commented Jan 16, 2022 at 11:45

This is how I login to my Raspberry Pi:

IP=$(sudo nmap -p 22 --open -sV | grep 192 | awk '{print $NF}') && ssh pi@$IP

Find open SSH port on the local network, get the ip, SSH into it.


I spend little time on it to figure out and finally one solution that worked fine.

Have a look at this one http://angryip.org/download/#windows

I believe "arp -a" will also give the IP but the tool which I mentioned above will give info in detail.

enter image description here

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