How to Set Static IP Address on Raspberry Pi 1

How to Set Static IP Address on Raspberry Pi

The Raspberry Pi is mostly about networking and having a static IP address is a must if you are rerouting your internet traffic or automatically connecting other network devices to the RPi. If the IP address keeps changing, your whole setup is broken and you have to manually reconfigure the IP address. To make things easy for you, here is a handy guide for setting a static IP address on Raspberry Pi. On that note, let’s go ahead and learn how to allocate Raspberry Pi’s IP address.

Set Static IP Address on Raspberry Pi (2021)

In this article, we discussed two methods of determining a static IP address on Raspberry Pi. If you are comfortable with terminal, you can go with the first method. But if you want to change it via a graphical interface, follow the router’s guide. You can switch to the section you want from the table below.

Set a Static IP Address Using Raspberry Pi’s Terminal

1. First, open terminal If you are using the graphical user interface of Raspbian OS. You can also remotely SSH to Raspberry Pi to connect to Terminal from your Mac, Windows PC or smartphone.

2. Next, enter the following command by entering the following command. valid IP address of your Raspberry Pi. Note as we will be using the existing IP address to make it static.

hostname -I
Install Raspberry Pi Web Server (2021)

3. After that, execute the following command to open it. dhcpcd.conf File via nano editor. One of the nano keyboard based editorso you can’t use your mouse to move between lines and edit the file.

sudo nano /etc/dhcpcd.conf
How to Set Static IP Address on Raspberry Pi

4. Now scroll down and go to the bottom. Here you will find four lines starting with “.interface”.

How to Set Static IP Address on Raspberry Pi

5. Go to “Static ip_address” and change highlighted part Navigate to your current IP address (which we specified in step 2) of the Raspberry Pi in the screenshot below. You can also assign a private IP address if you wish. You don’t need to touch anything else.

How to Set Static IP Address on Raspberry Pi

6. Now click ““ to save the file.Ctrl + X” and press enter. Finally, press the “Y” key to save the changes.

7. Run the following command in terminal to instantly reboot your Raspberry Pi. In the meantime, you can check out the best Raspberry Pi commands from our linked article.

sudo reboot
sudo reboot

8. That’s it. There is assigned a static IP address To your Raspberry Pi in a few easy steps. Now your router will only use the static IP address you set for your Raspberry Pi.

Using Router Settings to Set Static IP on Raspberry Pi

If you don’t want to mess with Raspberry Pi’s Terminal, there is another easy way to set a static IP address on Raspberry Pi. Necessary access your router’s admin page. Generally, 192.168.0.1, but it may differ depending on your router. You may need to look online to find the router’s address.

1. Open a browser on any device in your local network, 192.168.0.1and press Enter. Now, enter default credentials for your router and sign in. Usually both username and password adminbut if that doesn’t work, look for default credentials on the internet or behind the router.

Configure Your Router

2. Next, select “DHCP server” or “address reservation” option. I am using a TP-Link Archer C6 router and the DHCP server setting is available under Advanced -> Network. For other routers, it may be found under a different page, so we recommend searching the internet and finding the settings page.

DHCP Server

3. Here, scroll down to the “Address Reservation” section. Basically, you can reserve the Raspberry Pi’s IP address so it won’t be assigned to another device on your home network. In tandem, you assign a static IP to the Raspberry Pi through your router.

address reservation

4. Click “Add” and enter the Raspberry Pi’s IP address in the “Reserved IP Address” field. You can find it by entering the IP address of your RPi board. hostname -I In the terminal. to find MAC address of your RPi, scroll down and search for the specified client list on the same admin page. Next, give the “Description” field a name and tick the “Enable This Entry” checkbox. Finally, click “Save”. It will store the current IP address of the Raspberry Pi and make it a static IP.

DHCP Server

In case 5, Can’t find MAC address Open Terminal in RPi from your Raspberry Pi and run ifconfig. Check the value of “ether” under “wlan0”. This is the MAC address of your RPi.

Mac Address

7. Finally, restart your routerand Raspberry Pi will now always be assigned to the same IP address you have reserved on your router.

Assign Static IP Address to Raspberry Pi in Few Easy Steps!

So you can easily set a static IP address on your Raspberry Pi. This guide will be very helpful if you are setting up a Pi-hole on your Raspberry Pi or pointing another network device in your home network to the mini card. Anyway, that’s it for us. If you run into any issues, comment them below and let us know. We will try to help you.

Support our work ❤️

If you enjoyed this article, consider leaving a tip to help us keep publishing great content.

Secure payment on PayPal
Moyens I/O Staff is a team of expert writers passionate about technology, innovation, and digital trends. With strong expertise in AI, mobile apps, gaming, and digital culture, we produce accurate, verified, and valuable content. Our mission: to provide reliable and clear information to help you navigate the ever-evolving digital world. Discover what our readers say on Trustpilot.