Skip to content

How-to / Raspberry Pi

Find and assign a Raspberry Pi's IP address

Discover your Raspberry Pi's IP address and learn how to set a static IP so it never changes. Whether you use the desktop, command line, or your router, this guide covers all the methods.

BeginnerNetworking · IP addressBy Vilros

Find your Pi's IP address

An IP address is a series of numbers that computers use to identify themselves on a network, similar to a phone number. For most purposes, you probably won't need to deal with your Pi's IP address directly, but it's useful information to have for network access and troubleshooting.

METHOD A

From the desktop

This is the simplest method. Hover your mouse pointer over the network icon (WiFi or Ethernet) to the left of the clock in the menu bar. A tooltip window will appear showing your Pi's IP address.

METHOD B

From the command line

  1. Open Terminal.
  2. Type the following command and press Enter:
    ip a
  3. You'll see detailed network information. Look for either eth0 (Ethernet) or wlan0 (WiFi), depending on how you're connected.
  4. Find the line starting with inet. The IP address appears right after it, before the slash. For example: inet 192.168.1.42/24 means your IP address is 192.168.1.42.

You can also use hostname -I (capital i) for a simpler output that shows only IP addresses.

Assign a static IP address

IP addresses are generally dynamic, meaning they can change if your router needs to reassign them. If you want to connect to your Pi using its IP address, a changing address would be problematic—like a friend changing their phone number without telling you.

A static IP address tells your Pi to keep the same address permanently. There are three ways to set this up, listed from simplest to most advanced.

METHOD A

Router assignment (recommended)

The best and simplest way is to use your router's static IP (sometimes called reserved IP or DHCP reservation) feature. Every router is different, so check your router's help documentation, web interface, or mobile app.

The advantage of this method is that it's usually straightforward and, since you're configuring the router itself, there's little chance of misconfiguration or conflicts on your network.

METHOD B

Pi desktop (NetworkManager)

This method works for both Ethernet and WiFi connections.

  1. Click the network icon in the top-right corner, next to the clock.
  2. Select Advanced Options → Connection Information.
  3. Take note of the information under IPv4, especially the Default Route (your router's IP address). You'll need this later.
  4. Now select Advanced Options → Edit Connections...
  5. In the window that appears, you'll see listings for Ethernet and WiFi connections. Select the one you're using and click Edit.
  6. Go to the IPv4 Settings tab.
  7. Change the Method dropdown to Manual.
  8. Click Add under the address table and enter:
    • Address: The IP address you want to assign (e.g., 192.168.1.100). Choose an address outside your router's DHCP range to avoid conflicts.
    • Netmask: Enter 24 (equivalent to 255.255.255.0).
    • Gateway: Enter your router's IP address from the Default Route you noted earlier (e.g., 192.168.1.1).
  9. For DNS Servers, you can usually use your router's IP address, or verify with:
    cat /etc/resolv.conf
    Use the nameserver address shown.
  10. Click Save, then reboot your Pi for the changes to take effect.

METHOD C

Command line (nmtui)

  1. Open Terminal and run:
    sudo nmtui
  2. Select Edit a connection and press Enter.
  3. Choose your active WiFi or Ethernet connection and select Edit...
  4. Scroll down to IPv4 CONFIGURATION and press Enter to change it to Manual.
  5. Select Show next to the manual configuration and press Enter.
  6. Enter the same information as in Method B:
    • Addresses: Your desired IP address with /24 suffix (e.g., 192.168.1.100/24)
    • Gateway: Your router's IP address (e.g., 192.168.1.1)
    • DNS servers: Your router's IP or another DNS server
  7. Select OK, press Enter, then navigate back and select Quit.
  8. Reboot your Pi.

Use a hostname instead

Another way to always reach your Pi—even if the IP address changes—is by using a hostname. Think of it like a name: your friend can change their phone number but probably won't change their name.

You can give your Pi a hostname that stays the same regardless of IP address changes. The default hostname is usually raspberrypi, and you can reach it at raspberrypi.local from other computers on the same network.

METHOD A

Desktop method

  1. Open the Raspberry Pi menu and go to Preferences → Raspberry Pi Configuration.
  2. Select the System tab.
  3. Click Change Hostname...
  4. Enter your desired hostname (letters, numbers, and hyphens only—no spaces or special characters).
  5. Click OK and reboot when prompted.

METHOD B

Command line method

  1. Check your current hostname:
    hostname
  2. To change it, run:
    sudo raspi-config
  3. Select System Options, then Hostname.
  4. Enter your new hostname and confirm.
  5. Exit raspi-config and reboot.

After setting a hostname, you can reach your Pi at your-hostname.local from other devices on the same network (requires mDNS/Bonjour support, which is built into macOS, iOS, and Linux, and available for Windows via Apple's Bonjour for Windows).

If it doesn't work

  • IP address not showing on desktop: Ensure you're connected to a network (WiFi or Ethernet). Check that the network icon shows a connection.
  • Can't connect after setting static IP: Verify you chose an IP address outside your router's DHCP range and that you entered the correct gateway and DNS addresses. Check for typos in the IP address format.
  • Hostname.local doesn't resolve: Confirm mDNS is working on both the Pi and the computer you're connecting from. On the Pi, check that the avahi-daemon service is running: sudo systemctl status avahi-daemon. On Windows, you may need to install Bonjour for Windows.
  • Lost connection after changing settings: If you can't reach your Pi, connect a monitor and keyboard directly, then check your network settings or revert to DHCP by changing the Method back to Automatic in nmtui.

Need help with networking?

Tell us your connection type (WiFi or Ethernet), what you see when you hover over the network icon, and which static IP method you tried.

Contact Vilros Support ↗