DEV Community

Hedy
Hedy

Posted on

How can I find the static ip of my Raspberry Pi device?

You can get your Raspberry Pi’s IP in a few different ways, depending on whether you can access the Pi directly or not. I’ll cover both.

1. If you can plug in a monitor & keyboard

Log into the Pi (default user is often pi):

A) Quick one-liner (most common)

hostname -I
Enter fullscreen mode Exit fullscreen mode

The first address it prints is usually your Pi’s IPv4 address on the LAN (e.g. 192.168.1.50).

B) More detailed

ip addr show
Enter fullscreen mode Exit fullscreen mode

Look under your active interface:

  • eth0 for wired
  • wlan0 for Wi-Fi

Find the line with inet:

Example: inet 192.168.1.50/24 → IP = 192.168.1.50.

C) Check if it’s static on the Pi

On Raspberry Pi OS:

Old style (with dhcpcd):

sudo nano /etc/dhcpcd.conf
Enter fullscreen mode Exit fullscreen mode

Look for a block like:

interface eth0
  static ip_address=192.168.1.50/24
  static routers=192.168.1.1
  static domain_name_servers=192.168.1.1
Enter fullscreen mode Exit fullscreen mode

If present and not commented out, that’s a static IP set on the Pi.

Newer Raspberry Pi OS versions may use NetworkManager:

nmcli connection show
nmcli connection show "<your-connection-name>"
Enter fullscreen mode Exit fullscreen mode

In the details you’ll see something like ipv4.method manual and an ipv4.addresses entry if it’s static.

2. If you can’t plug in a monitor (headless Pi)
A) Try the hostname (mDNS)

On many networks the Pi is reachable as:

raspberrypi.local
Enter fullscreen mode Exit fullscreen mode

From another PC on the same network:

  • On Windows: try ping raspberrypi.local in Command Prompt.
  • On macOS/Linux: same in Terminal.

If that works, you can then run:

ssh pi@raspberrypi.local
Enter fullscreen mode Exit fullscreen mode

Once logged in, use hostname -I as above to see the numeric IP.

B) Look in your router’s web interface

Log into your home router:

  • Open a browser and go to something like 192.168.0.1 or 192.168.1.1.
  • Find the “Connected Devices”, “DHCP Clients”, “LAN Status” or similar page.
  • Look for a device named:
    • raspberrypi
    • or the Pi’s MAC address (starts with something like B8:27:EB or DC:A6:32 on older Pis, E4:5F:01 etc. on newer).

If you previously set a static lease in the router (static IP assigned by the router to that MAC), the address you see there is effectively your Pi’s static IP.

C) Scan your network (if router UI is limited)

From a PC on the same LAN you can scan your subnet:

On Linux/macOS (with nmap installed):

sudo nmap -sn 192.168.1.0/24
Enter fullscreen mode Exit fullscreen mode

Then look in the results for raspberrypi or for a vendor string like Raspberry Pi Trading Ltd.

On Windows you can use GUI tools like Advanced IP Scanner or Angry IP Scanner to find it similarly.

3. Checking whether the IP is really static

Once you know the IP (e.g. 192.168.1.50), there are two main ways it might be “static”:

1. Static on the Pi itself

Configured in /etc/dhcpcd.conf or via NetworkManager (ipv4.method manual).

2. Static lease on the router

DHCP server always gives that Pi the same IP based on its MAC.

To confirm:

  • If no static config on the Pi, but router shows a “reserved” or “static” lease for that MAC, then the router is making it static.
  • If both places are dynamic (no static config on Pi, no reservation in router), the IP is dynamic and can change.

Top comments (0)