When you buy a new Raspberry PI and want to start your project which requires a remote connection, you’ll need to install operating system and then connecting from a remote device (usually a desktop PC or smartphone). In these cases, you must know your Raspberry PI’s IP address.
In this tutorial I’m going to show you how to find your RPI IP address inside your home network. If you want to find how to access from internet, then you probably need to read my No-IP guide.
An Internet Protocol address (IP address) is label composed by chars/numbers separated by dots.
There are 2 IP versions:
Before going ahead, in this article we’ll refer only to IPv4 addresses, because IPv6 usage is really rare.
Each device connected to a computer network needs to have a single and unique IP address. This way, every request sent to a specific IP can reach only one device.
Beside IP address, a netmask is a similar label: still 32-bit value, its readable forma has 4 numbers divided by dots. Netmasks are used to separate logically networks and optimize traffic routing. For example with a netmask 255.255.255.0 (also known as “/24”) all devices which has same first 3 numbers are on same sub-network.
Some IP address have special functions and their use is forbidden for devices networking interfaces. Let’s consider a classical home network where 192.168.1.x (last digit being variable and lower than 255) are IP addresses and netmask 255.255.255.0
More info about IP addresses can be found in Wikipedia IP address page.
There are different way depending from where you want to discover it. You may need to get IP from inside your RPI, from a remote PC inside the same home network or from your router where Raspberry PI is connected (last 2 ways being needed for headless installations).
Linux distributions usually name networking interfaces as follows:
If your Raspberry PI is connected with Wi-Fi, then its IP address is the one acquired by wlan0 interface. If it is connected with a cable, then eth0 is the reference.
In this case, you need to have a monitor and keyboard. In this case, a common way to get IP info is from terminal console. If you have a desktop-less installation, then you are already on terminal after login. If you have a desktop installation, then open Terminal app from available applications.
Regardless of what Linux distribution you have installed in your Raspberry PI, usually the “ifconfig” command will give detailed info on current networking configuration. With my RPI 3 model A+ (which has only wi-fi interface, but procedure is same for all Raspberry PI boards):
pi@raspberrypi:~ $ ifconfig
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163 mtu 1500
inet 192.168.1.177 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::ad11:c8a2:8206:7699 prefixlen 64 scopeid 0x20
ether b8:27:eb:d9:f9:5f txqueuelen 1000 (Ethernet)
RX packets 1932 bytes 220936 (215.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1389 bytes 277071 (270.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
“lo” interface identify loopback interface. Underlined value is my PI address.
A terminal command which simplify reading is the following:
pi@raspberrypi:~ $ ifconfig wlan0 | grep 'inet '
inet 192.168.1.177 netmask 255.255.255.0 broadcast 192.168.1.255
Of course, change “wlan0” with “eth0” with wired connections.
Raspberry PI headless installations (without keyboard and monitor) require finding RPI address with alternative ways.
If you are lucky and your device supports mDNS (multicast DNS) you can be able to find IP from a remote PC on same home network with a ping:
ping raspberrypi.local
Where “raspberrypi” is default hostname for your PI. If this command returns a correct answer:
PING raspberrypi.local (192.168.1.177): 56 data bytes
64 bytes from 192.168.1.177: icmp_seq=0 ttl=255 time=2.618 ms
then you found the address. If this command results in something like following:
Ping request could not find host raspberrypi.local. Please check the name and try again.
then you need to move on.
A valid tool to use is Angry IP scanner. This usefull free software is available both for Windows, Linux and MacOS. Windows version also allows to dowload and use “Executable” which are portable version (don’t need installation).
Download it and open:
Once setup ip range to scan, pressing start button starts to asks all IP in this range to resolve its hostname. Results will be similar to following image:
You will find a row where hostname matches to raspberrypi.local, near your Raspberry PI’s IP found.
This way can be more complex for people with very low experience with routers and it won’t be a solution if you don’t have access to router.
This is also the most varying way because it will be strictly depending on your router brand and version.
The target is finding in your router dashboard clients list, where probably you will see a new entry with your raspberrypi hostname.
In my home I have an ASUS DSL-AC68U I can find it directly from home dashboard:
By clicking “View List” in Clients snippet I will find all connected client:
Again, the one named raspberrypi will show related IP address.
Enjoy!
In this tutorial, we will use two Arduino Uno to demonstrate the Serial Peripheral Interface…
In this tutorial, we will be making an automatic irrigation system (AIS) with Arduino and…
This tutorial will show you how to use Python Virtual Environment with Raspberry PI computer…
This tutorial will show you how to get betting odds with Raspberry PI by using…
This tutorial will show you how to perform the backup of Raspberry PI (computer board)…
This tutorial will show you how to install Honeygain on a Raspberry PI computer board…