How to find Raspberry PI’s IP

3.4
(5)

Last Updated on 6th February 2022 by peppe8o

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.

Raspberry PI 4 model B image

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.

What is an IP address

An Internet Protocol address (IP address) is label composed by chars/numbers separated by dots.

There are 2 IP versions:

  • IP version 4 (IPv4) – most spread and used. It is a 32-bit number. In this case IP address is represented with 4 numbers (each one being between 0 and 255) separated by dots. An example is “192.168.0.100”
  • IP version 6 (IPv6) – going to be the (far) future. It is a 128-bit number. In this case IP address is represented with 8 exadecimal numbers separated by dots. An example is “2001:db8:0:1234:0:567:8:1”

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

  • 127.0.0.1 is used by devices to identify itself
  • first IP address in a subnet identify the subnet itself (192.168.1.0)
  • last IP address in a subnet is used for broadcast messages (communications which need to be spread to all devices connected to the sub-network (192.168.1.255)

More info about IP addresses can be found in Wikipedia IP address page.

Ways To Get Raspberry PI’s IP address

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:

  • eth0 – for wired interfaces
  • wlan0 – for wireless (wi-fi) interface

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.

Get IP from Raspberry PI OS

RPI 3 model A+

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.

Get IP from Remote PC

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:

Angry IP scanner home

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:

Angry IP scan result Raspberry PI

You will find a row where hostname matches to raspberrypi.local, near your Raspberry PI’s IP found.

Get IP from Router

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:

ASUS DSL-AC68U home client list highlighted

By clicking “View List” in Clients snippet I will find all connected client:

ASUS DSL-AC68U client list raspberry pi

Again, the one named raspberrypi will show related IP address.

Enjoy!

How useful was this post?

Click on a star to rate it anonymously!

Average rating 3.4 / 5. Vote count: 5

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?