You frequently need to know your Raspberry Pi‘s IP address. To set up any networking-related service, such as SSH, you will need the IP. Whether you're using the Pi as a web server, print server, or file server, you also need to know the IP.
Using the GUI, command line, or network scan—all of which are covered in this article—you may quickly find the Raspberry Pi's IP address.
1. Find the IP Address in the GUI
Finding your Raspberry Pi's IP address is simple when using the desktop version of the Raspberry Pi OS. Just move your mouse pointer over the network icon in the top panel, and it should show the IP address right away.
Clicking the Network icon shows the IP address if you are running a different OS, such as Ubuntu or Ubuntu MATE.
2. Find the IP Address From the Command Line
Enter the following terminal command to find the Raspberry Pi's IP address on the local network:
Unlike some other network commands, this will filter out all the unnecessary details and offer only the IP address. It shows both addresses if you have an Ethernet and Wi-Fi address connected to the network. Additionally, take note of the capital I; if you enter the command hostname -i instead, you will get the Raspberry Pi‘s internal loopback address, also known as localhost.
Use the following command to learn more about the network interfaces on the Raspberry Pi:
The IP command has superseded ifconfig on modern versions of Linux. Provide the following information to display the IP addresses of your network interfaces:
3. Find the IP Address of a Raspberry Pi From the Router
Since your Raspberry Pi is often headless, it can only be accessed over SSH. When you use a microSD card loaded with the OS and connect the Ethernet, allocation of an IP address to the Raspberry Pi takes place. Yet, due to the absence of a display, the IP address is unknown. These IP addresses are allocated by the router's DHCP server. The information is provided in the router's address table.
Looking at the address table, identifying the Pi's IP address is straightforward. This is due to the fact that, unless you alter it, Raspberry Pi OS typically uses “raspberrypi” as its hostname. The hostname may show up as “retropie” if you're using the RetroPie games emulation system.
Moreover, the Raspberry Pi may have an IP address reserved. This helps since you don't need to look up the IP address every time you run a headless setup. The Pi would thus get the same IP address every time it connected to the network in this manner. Using the router's address reserve function makes this feasible. Every device that connects to the network has a MAC address. Every time a connection request from that MAC address is received by the router, the same IP address is assigned.
4. Find the IP Address of a Raspberry Pi From a Different Computer
There can be a situation when you don't have access to the router's settings. For example, you have set up the Raspberry Pi as a web server and you know that the Pi is connected to the network. You could ping every IP address in the network and then resolve the hostnames, but it would be tedious. Thankfully, some tools perform the same task, called network scanners.
On Linux OS:
Linux systems may use the network scanner tool Nmap (Network Mapper). You may use it to scan the network for the Pi.
sudo nmap -sn [Your router's IP address]/24
On Windows OS or macOS:
Angry IP Scanner is a graphical user interface (GUI) application available for Windows, macOS, and Linux. The application will get the Raspberry Pi's IP address from the results when executed.
5. Find the IP Address of Your Raspberry Pi From a Mobile Device
Fing is a network scanner app that is available for both Android and iOS. It performs the job of scanning the network to find all devices. Launch the app after installation. It will list all the network devices.
6. What About the Public IP Address on a Headless Raspberry Pi?
The methods previously outlined are to find the private IP address (inside your local network); however, there are differences between public and private IP addresses. You will need the Pi's public IP address to connect to it from outside the network.
Let's say your Raspberry Pi is running a server operating system. To find your public IP address, you would typically visit a third-party website like WhatsMyIP.org. Yet, there is no web browser on the server OS. Alternatively, you may use the curl command to find your public IP address.
Finding the IP Address of Your Raspberry Pi Is Easy
You now know how to find a Raspberry Pi's IP address. It would also be helpful to know how to set a static IP address for the Raspberry Pi. Understanding networking may help you get the most out of your Raspberry Pi, which has always been its strong point.