FREE SHIPPING WITHIN THE USA
30-Day Easy Returns 30-Day Easy Returns
Secure Checkout Guaranteed Secure Checkout Guaranteed
Free Shipping in USA Free Shipping in USA

Your Cart 0 Items

Shipping: Free
Sub Total: $0.00

How to Find and Assign a Raspberry Pi's IP Address

An IP address is a series of numbers that computers use to identify themselves to each other through various protocols and such devices as hubs, switches, and routers. It’s a fairly complicated topic and beyond the purview of this guide to explain fully, but for our purposes, imagine that an IP address is like the phone number you use to call someone. That phone number, for all intents and purposes, IS that person.      

Of course, people have names as well, and so, it turns out, do computers. We’ll get to that in a moment.

First of all, realize that for the most part, you probably won’t need to deal with your Pi’s IP address, but it’s still good information to have and know.

To find your Pi’s IP address, you can use the desktop or you can use the command line via the Terminal app.

Desktop: This is a simple process. Just hover your mouse pointer over the wifi or ethernet icon to the left of the clock in the menu bar. A gray window will pop up, telling you the IP address of your Pi.

Command Line: Open the Terminal app and type ip a, then hit return. You’ll receive a screen of information like the one below. Depending on how you’re connected to the network, look at either eth0 (ethernet) or wlan0 (wifi) to find your IP address after the text inet.

Assigning a Static IP Address to a Raspberry Pi

IP addresses are generally dynamic, which means that they can change if the router needs to shuffle them around. Since the router has assigned the new number, it knows what the new number is, so that’s fine…but what if you want to connect to that machine with its IP address? If the IP address has changed, you’d have no way to know, as though a friend had changed their phone number and never told you.

Enter the static IP address. You can tell your Pi not to give up its IP address, so it will always be the same.

There are multiple ways to set a static IP address for your Pi, and all of them involve some measure of getting your hands dirty!

A.      Router Assignment

The best and simplest way to assign a static IP address is to use the static IP (sometimes called reserved IP) feature of your router. Unfortunately, every router is different and so it is beyond the scope of this tutorial to explain the process. Check the Help feature on your router’s web page or in its app. The beauty of using the router to set your static IP address is that the process is usually quite simple and since you are configuring the address on the router itself, there is little chance of there being a problem down the road.

B. Pi Desktop

The following steps will work for either ethernet or wifi connections.

Start by clicking on the network icon in the top right corner, next to the clock. Select Advanced Options then Connection Information. Take note of the information under IPv4, especially Default Route. You’ll need it later.

Now click Advanced Options and then Edit Connections… In the window that comes up, you’ll see listings for both ethernet and wifi connections. Choose whichever one you’re using and then click on the edit button. Now go to the tab labeled IPv4 Settings and roll up your sleeves.

 

   Change the Method to Manual.

   In the Address field, enter your IP address from the Connection Information window above.

   For Netmask, enter 24.

   For Gateway, enter the router’s IP address, which is the address after Default Route that you looked up before.

   For DNS Server, you usually use the same Default Route. But just to be sure, enter cat /etc/resolv.conf into Terminal and use the address that comes up.

   Click Save to apply changes

   Reboot your Pi.

 

C. Command Line

You’ll be using Terminal to perform all of the following functions:

   Enter sudo nmtui to open the Network Manager utility.

   Choose Edit a Connection.

   Choose your wifi or ethernet connection, depending on which you’re using.

   Choose Edit…

   Scroll down to IPV4 CONFIGURATION and press Enter to change to Manual.

   Select Show and hit Enter to bring up an interface where you can enter the information for your static IP address, your Gateway, and your DNS Server, as in Step 4B above.

   Select the OK button, hit Enter, then back out of the interface and reboot your Pi.

 

 

5. Hostname

Another way to always be in touch with your Pi, even if the IP address changes, is via a hostname. Think of it this way: Your friend can change their phone number, but probably won’t change their name. You can give your Pi a name that will always remain the same, even if the IP address changes.

If you followed the Basic Assembly Guide, then you’ve already given your Pi a hostname. If not, here’s how you can do so:

On the Raspberry Pi desktop, use the Raspberry Pi menu to open our old friend, the Control Center. In Control Center, choose System. You will see an option to Change Hostname… Click on it. Don’t worry — nothing will change unless you want it to.

Now you’ll see your current hostname; change it if you like, or leave it the same. If you hadn’t assigned a hostname before, you can do so here.

To do the same in the Terminal, simply type hostname to see your current hostname. Easy, right?

To change your hostname in the Terminal, enter sudo rasp-config, which will bring up the configuration interface. Press Enter to select the first choice, System Options. Scroll down to Hostname and hit Enter again. Now you will see your current hostname and have the option to change it.