Finding Your Raspberry Pi’s IP Address: A Quick Guide

Most users will want to configure their Raspberry Pi to join the local network, and maybe even have an internet connection. In order to remotely connect to the Raspberry Pi or to configure related networking settings, a user will first need to obtain the device’s IP address. In this tutorial, we will show you how to find the IP address of a Raspberry Pi. This will include the internal (or private) IP address, as well as the external (or public) IP address, if one is assigned.

In this tutorial you will learn:

  • How to find Raspberry Pi’s IP address via GUI
  • How to find Raspberry Pi’s IP address via command line
Finding Your Raspberry Pi's IP Address: A Quick Guide
Finding Your Raspberry Pi’s IP Address: A Quick Guide
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Raspberry Pi
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Find Raspberry Pi IP address




Open a command line terminal and try some of the commands below to find the IP address of your Raspberry Pi. In the last method, we also show how to retrieve the Raspberry Pi IP address via GUI.

DID YOU KNOW?
A quick way to check your public IP address from the Raspberry Pi is to navigate to a website like WhatIsMyIP.com or IPChicken.com.
  1. To see your local IP address, you can run the following command in terminal:
    $ ip a
    

    This command reveals both the IPv4 address and IPv6. They have been circled in the screenshot below.

    Retrieving local IP address with ip a command on Raspberry Pi
    Retrieving local IP address with ip a command on Raspberry Pi
  2. Another quick way to see your local IP address is with the hostname command and the -I option. This gives us a concise output that only contains the local IPv4 and IPv6 addresses.
    $ hostname -I
    

    Output of the hostname -I command on a Raspberry Pi
    Output of the hostname -I command on a Raspberry Pi



  3. To display the default gateway IP address, run this command:
    $ ip r
    
  4. There are also various ways to get your public IP address. You can go to a website like ip chicken or execute one of the following commands in terminal:
    $ echo $(wget -qO - https://api.ipify.org)
    OR
    $ echo $(curl -s https://api.ipify.org)
    
  5. To find the Raspberry Pi IP address via GUI, you can place your mouse cursor over the network icon in the upper right corner of your desktop. This will show the local IP address for any interface that is currently configured. In the screenshot below, we can see the IP address of our WLAN interface.
    Finding the IP address of Raspberry Pi via GUI desktop
    Finding the IP address of Raspberry Pi via GUI desktop

Closing Thoughts




In this tutorial, we saw how to find the IP address of a Raspberry Pi. This can be done via command line or GUI, and can reveal both the public and private IP addresses for our Raspberry Pi. The ip command will also allow a user to see their device’s MAC address, default gateway, and DNS information.



Comments and Discussions
Linux Forum