How to find the IP address of your Raspberry Pi?
ⓘ This article may have been partially or fully translated using automatic tools. We apologize for any errors this may cause.
Tutorials often ask you to connect to the IP address of the Raspberry Pi, but how do you find that IP address?
Let's see how to find the local IP address of your Raspberry Pi in 3 different ways, with or without a GUI.
Note that when a tutorial tells you about the IP address of the Raspberry Pi, it is usually talking about the IP address inside your local network. The public IP address, it is used to identify you on all Internet and in fact directs towards your modem and not your personal machine. You can easily find it through online sites like myip.com.
The necessary equipment
To follow this tutorial, you will need the following materials:
- A Raspberry Pi connected to your box (in Ethernet or in Wifi, not important).
- Its power supply
- An SD card with your OS installed
- A screen with at least one mouse connected to the Pi, or a computer or external phone.
For the rest, we assume that your Raspberry Pi is on and connected to your box.
How to find the IP of a Raspberry Pi under Raspbian connected to a screen.
First case that we are going to discuss, your Raspberry Pi runs on Raspbian, has a display and has a mouse.
This is the simplest case, you just have to drag your mouse over the network icon at the top right of the Raspbian menu bar and a help bubble will appear after a few moments with your IP adress !
Be aware that you will find relatively equivalent techniques for most other operating systems compatible with the Raspberry Pi. Thus, you can usually find the IP of your Raspberry in the part of the system dedicated to the network connection.
For information, if you don't have a desktop and only a screen with the command line, you can type the command below in the terminal of your Raspberry Pi to find its IP:
How to find the IP through the modem admin interface
If your Raspberry Pi is not connected to any display, you can find its IP address from your modem's administration interface.
To access it, open your browser and go to the address indicated in the manufacturer's documentation. Some access providers write it directly on a label stuck to the box.
But before you bother looking through your papers, try the following addresses:
Chances are good that one of them matches your admin interface.
You will then have to connect (and there is no magic, you will have to go and read the label of the box) to access the admin interface.
Once connected, you will most likely find a page in the administration panel allowing you to see all the equipment connected to your modem.
This method is simple from a technical point of view, but it has two big drawbacks. The first is that you have to look in your papers or dig through the cables to find the identifiers. The second is that on some modems the functionality works so badly that half of the peripherals are not displayed.
If you do not have the motivation to go through your papers or your modem does not display the Raspberry Pi, in this case I recommend the method below instead.
Find the IP of your Raspberry Pi from another computer on the same network.
If your Raspberry Pi does not have a display, you can find its address from another computer connected to the same box.
To do this, we are going to use a tool called Nmap, which allows you to perform many actions related to the detection of machines and ports on the network.
Install Nmap on Linux
The advantage of Nmap is that it is installable on Linux, Windows, Mac OS, and even Android with the "NetworkMapper" application.
To install Nmap on Linux, nothing could be easier, it is most likely in the repositories of your distribution. So use your repository manager to install Nmap. For all Debian databases (Debian, Ubuntu, Raspbian, etc.), this therefore gives:
sudo apt install nmap -y
Install Nmap on Windows and Mac OS
Installing Nmap on Windows or Mac isn't much more complicated. All you need to do is go to the official Nmap website in the "Download" section, and follow the instructions for your version of the system.
Find the IP of your Raspberry Pi with Nmap
Now that Nmap is installed, all you have to do is scan the network to find your Raspberry Pi.
But before doing that, first turn off your Raspberry Pi and wait 30 seconds. You will understand why soon after.
Did you wait 30 seconds? Alright, now let's scan the network with the following command:
nmap -sP 192.168.0.1/24
For Linux type it directly into the terminal, for Windows and Mac OS launch Nmap's graphical interface named Zenmap, and type the command in the "Command" field.
Note, depending on your service provider, you may need to use
192.168.1.1/24 in place.
This command will, in fact, ask Nmap to send a Ping to all machines belonging to the network.
You will then have a return with the IP addresses of all the machines on your network (and sometimes with their host name).
That's nice, but how do I find my Raspberry Pi now? Well it's very simple. Since we had unplugged the Raspberry Pi before scanning the network, its IP address does not appear in the list.
Turn the Raspberry Pi back on, wait for it to be connected to the network, and reissue the command. Compare the two lists of addresses, the IP which was not in the first list is that of your Raspberry Pi!
Note all the same, several IPs can appear at once, because one IP did not respond to the first command, or another device has connected to the network in the meantime.
In this case, you just have to try the different IPs, there are usually not many. For example by trying to connect to it in SSH if you have activated it.
Sometimes you will even be lucky and the hostname (which often contains
raspberry) will be marked on the Pi's IP!
You know the IP address of your Raspberry Pi, all you have to do is connect to it!