I've configured my RPi to be headless, and plugged it into my router. How do I discover the local IP address so I can ssh into it?

Update: Lots of documents point out that you can log into the router and look at the DHCP table. What if you don't have login credentials to the router? (I apologize for adding that restriction post-facto!)

  • 90% of the time people never change the login credentials from the factory defaults. If you can actually get your hands on the router, there is a very good chance that the username is admin and the password is the serial number. Or just locate the make and model and google search the default login credentials.
    – Dbo
    Apr 8, 2014 at 12:29
  • Try telling that to Verizon/FIOS! :) (In my case, the router is in my in-law's apartment and Verizon set the password when they installed it.) Apr 8, 2014 at 17:43
  • 1
    2022 answer: Just use ping raspberrypi.local, raspbian comes with DNS multicast by default:) Oct 14, 2022 at 21:54
  • 1
    @DrGorilla.eth You should make that a full fledged answer so it doesn't get lost in the fine print! Oct 18, 2022 at 11:50
  • Unfortunately, I don't have enough rep on rasp SE:) If you post it as an answer, happy to upvote it! Oct 19, 2022 at 21:27

10 Answers 10



arp -a

You can also try tcpdump, but that isn't as clear.

If you know the routers local IP address, type that into your browser and login. From there, depending on your router, you'll have a different set of options with information about your network including all wireless devices connected to the routers.

Apple's time machine/airport express makes this easy.

From any other router you'll probably have to look for a LAN tab then your IP Address allocations tab.

  • Would have commented for your router type but not enough reputation.
    – Dbo
    Apr 8, 2014 at 6:53
  • arp -a is way faster than nmap -sS, and doesn't require root privs! thanks for the tip. Apr 8, 2014 at 10:32
  • @fearless_fool my pleasure
    – Dbo
    Apr 8, 2014 at 13:40
  • Strangely enough: Immediately after booting my RPi for the first time, arp -a doesn't find it, but sudo nmap -sS does. Caveat emptor. Aug 23, 2014 at 22:38

Using arp -a is fast and easy, but I have found that under certain circumstances, it doesn't list all of the devices. (As an aside, I don't know why that happens. Any ideas?) Here's an approach that -- so far -- always appears to work. It just takes longer...

In a shell window on your host machine (you said you did want to log in using ssh, right?), type:

sudo nmap -sS

(This assumes your local network is 192.168.1.xxx). This will scan for devices on the local network. It may take a while, but when it completes, it will print out a number of entries, including one that reads something like this:

Nmap scan report for raspberrypi.home (
Host is up (0.016s latency).
Not shown: 997 closed ports
22/tcp   open  ssh
5900/tcp open  vnc
6000/tcp open  X11
MAC Address: 80:1F:02:DA:AF:0D (Edimax Technology Co.)

From this, we know the DHCP-assigned address is If you're using the default user account, it's now possible to log in via:

$ ssh pi@


When configuring your a headless RPi you can connect it directly to your computers ethernet port (must be model B).

On a Mac you must turn on "Internet Sharing" within "System Preferences". This will allow your computer to create a connection between your WiFi and the ethernet port, which your pi should be plugged into.

In this "Internet Sharing" scenario your computer will take the IP address (by default) while creating a DHCP server in the 192.168.2.X range.

Trying is what I almost always connected to when I didn't have a monitor. If not that I'd always get

When you finally gain remote access, take note of the IP and MAC addresses. Once you got them, look into DHCP Reservations and port mapping. Again, depending on your router, this might be very easy or very complicated.

Just use arp -a

  • But that's not true. Your router hands out addresses depending on what's plugged into it, so you can't assume that the RPi is at xxx.xxx.xxx.2 Apr 8, 2014 at 17:42
  • @fearless_fool Completely changed my answer. It has to do with connecting directly to your computers RJ45.
    – 1''
    Apr 8, 2014 at 23:41
  • Bumping you up a point -- I found it convenient to plug my new headless RPi into my MacBook enet port. I found I needed to do: Share From: Wi-Fi To computers using: Ethernet (and turned on Internet Sharing). Then my RPi turned up on subnet 2, just as you said, at (Maybe one of us should edit your answer!) Oct 23, 2014 at 4:39

I use a solution that requires internet access. It might be a bit of a workaround, but has done well for me:

When booting, my Raspberry Pi automatically sends an email with its own IP-address to a gmail account I created solely for that purpose. On my work notebook, I use thunderbird to automatically mark any email received via that gmail account as read, therefore I don't get annoyed by it. If I need to ssh, I look at the latest email and it states the IP.

The script works like this: cron triggers a python script when booted (see here), which then sends the email: elinux wiki - Python Script.

I hope this helps,


  • Heh. Configuring the RPi to send you e-mail means you had a way to communicate with it in the first place, e.g. a keyboard and display. That's what we're trying to avoid here. Apr 28, 2014 at 18:26
  • You could also edit the appropriate files directly on the sd card from another computer ;) that's how I do it...
    – LuWi
    Apr 28, 2014 at 18:32
  • The script in the wiki link did not work for me. It crashed when I tried running it. I found this script worked: gist.github.com/johnantoni/8199088 Feb 14, 2018 at 21:43

Better Answer for 2022:

As @DrGorilla.eth points out:

Just use ping raspberrypi.local, since raspbian now ships with DNS multicast by default.

  • That gives me the IPV6 address. To get the IPV4 address, use ping raspberrypi.local -4 Dec 13, 2022 at 2:21

Not quite answering your question, but I find it easier to assign fixed IP addresses to my RPis. In my router I configure the DHCP settings so they allocate in a range (say 100-255) then I assign fixed IP addresses in the range below 100 for some on my machines.

Assuming I want to assign the IP address and myrouter (gateway) is, my /etc/network/interfaces file looks like:

# loopback
auto lo
iface lo inet loopback

# My config, Static IP
auto eth0
iface eth0 inet static

# Network address "family"

  • Yep, that works. It requires that you know the DHCP range assigned by your router. And there's a bootstrapping problem: editing /etc/network/interfaces without a keyboard & monitor is a bit tricky. Apr 8, 2014 at 10:26
  • You are right about the bootstrapping. I have a spare keyboard, mouse and monitor that I use when I'm setting up my PI installation. Once I've got the basics done (like the networking), I can go headless. It would be good to be able to build a configured installation, say from another machine, but that's a bit beyond me. Apr 17, 2014 at 0:29
  • I did a fairly detailed (but simple) writeup on setting up an RPi from scratch w/o a keyboard or mouse in the RPi forum: raspberrypi.org/forums/viewtopic.php?f=91&t=74176 Apr 17, 2014 at 2:41

if you cannot access the pi because you have no monitor or whatsoever you can access your router and check connected devices.

In your working computer type ifconfig (if linux) or ipconfig(if windows) you'll see your own IP and your default gateway. For me, for instance, it is: my IP and my gateway Your's will probably look similar.

Then go to your browser and visit (the gateway you discovered) and you'll be in your router webpage. If it asks for a password look around the router case, it may be printed somewhere, or in the papers they gave you with the router, or try admin.. it really works pretty often.

In the router you'll have a bunch of options but there is always one section where you can check the status of the device and the already connected devices (specially if you are in the Wlan)

If no device exhibits a clear name (like Raspberry, or anything you set in the raspberry) try unplug and re-plug the raspi and see what device disappears and re-appears in the list. This is your raspberry :)


You can configure Avahi Daemon so that your Pi is always listening on the address raspberrypi.local. See Step 1

You can also use Advanced IP scanner to search for it.

Hope this helps!

  • But you can only configure Ahavi Daemon if you have a keyboard and display to plug into it in the first place. That's what we're trying to avoid! :) And as Dbo points out, you can use arp rather than a commercial product to find the RPi's address. Apr 28, 2014 at 18:25

I just tried to get the IP address of my new RasPi 2. First boot and on the works DHCP network. So here's how you get the address:

1) Plug it into the network, boot the RasPi and wait for a the SD Card light to extinguish for at least 20 seconds. 2) Unplug the RasPi and connect it to you laptop or pc running wireshark and watch for packets that have the MAC address starting as "Raspberr_cd:38:32", the cd:38:32 is my last 3 digits of my MAC so yours will be different. 3) You should see some packets which have a arp request saying "who has IP address: x.x.x.x" and also "Tell n.n.n.n" Where n.n.n.n is the RasPi's address.

HTH, Dan


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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