How to Set a Static IP Address on Raspberry Pi

How to Set a Static IP Address on Raspberry Pi

Raspberry Pi is generally about networking, and having a static IP handle is a should if you’re redirecting your web site visitors or connecting different community units to RPi mechanically. If the IP handle retains on altering, your entire setup breaks, and it’s good to manually re-configure the IP handle. So to make issues simpler for you, right here’s a helpful information to set a static IP handle on Raspberry Pi. So on that notice, let’s go forward and learn the way to order Raspberry Pi’s IP handle.

Set a Static IP Deal with on Raspberry Pi (2021)

We now have mentioned two strategies to set a static IP handle on Raspberry Pi on this article. In case you are comfy with the Terminal, you’ll be able to go along with the primary technique. However if you wish to change it through a graphical interface, observe the router’s information. You may transfer to any part from the desk under.

Set a Static IP Deal with Utilizing Raspberry Pi’s Terminal

1. First, open the Terminal if you’re utilizing the graphical person interface of Raspbian OS. You too can SSH into Raspberry Pi remotely to connect with the Terminal out of your Mac, Home windows PC, or smartphone.

Connect Headless Raspberry Pi to Windows Laptop Without Ethernet or Monitor

2. Subsequent, enter the under command to search out out the present IP handle of your Raspberry Pi. Word it down as we’ll use the present IP handle to make it static.

hostname -I
Set Up a Raspberry Pi Web Server (2021)

3. After that, execute the under command to open the dhcpcd.conf file through Nano editor. Needless to say Nano is a keyboard-based editor, so you’ll be able to’t use your mouse to maneuver between traces and edit the file.

sudo nano /and many others/dhcpcd.conf
How to Set a Static IP Address on Raspberry Pi

4. Now, scroll down and transfer to the underside. Right here, you will see that 4 traces beginning with “interface”.

How to Set a Static IP Address on Raspberry Pi

5. Transfer to “static ip_address” and change the highlighted half within the screenshot under to your present IP handle of the Raspberry Pi (that we famous in step #2). If you want, you’ll be able to assign a customized IP handle too. You don’t want to the touch the rest.

How to Set a Static IP Address on Raspberry Pi

6. Now, to save lots of the file, press “Ctrl + X” and hit enter. Lastly, press “Y” to save lots of the modifications.

7. On the Terminal, run the under command to restart your Raspberry Pi immediately. By the way in which, you’ll be able to take a look at one of the best Raspberry Pi instructions from our linked article.

sudo reboot
sudo reboot

8. That’s it. You may have assigned a static IP handle to your Raspberry Pi in a couple of straightforward steps. Now, your router will solely use the static IP handle you’ve set in your Raspberry Pi.

Utilizing the Router Settings to Set Static IP on Raspberry Pi

When you don’t wish to mess with Raspberry Pi’s Terminal, there may be one other straightforward approach to set a static IP handle on Raspberry Pi. It’s essential entry your router’s admin web page. Usually, it’s 192.168.0.1, however it may differ based mostly in your router. You could have to look on the web to search out the router’s handle. 

1. Open a browser on any system in your native community, enter 192.168.0.1, and hit Enter. Now, enter the default credentials in your router and check in. Usually, each the username and password are admin, but when that doesn’t work, lookup the default credentials on the web or the again of the router. 

Configure Your Router

2. Subsequent, it’s good to search for the “DHCP server” or “Deal with Reservation” possibility. I’m utilizing a TP-Hyperlink Archer C6 router, and the DHCP server setting is obtainable underneath Superior -> Community. For different routers, it might be current underneath a special web page, so we advise you look it up on the web and discover the settings web page.

dhcp server

3. Right here, scroll down and transfer to the “Deal with Reservation” part. Mainly, you’ll be able to reserve the IP handle of the Raspberry Pi, so it’s not assigned to some other system in your house community. In tandem, you’re assigning a static IP to Raspberry Pi through your router.

address reservation

4. Click on on “Add” and enter the IP handle of Raspberry Pi within the “Reserved IP Deal with” discipline. You’ll find the IP handle of your RPi board by coming into hostname -I within the Terminal. To search out the MAC handle of your RPi, scroll down and search for the shopper checklist talked about on the identical admin web page. Subsequent, give a reputation within the “Description” discipline and activate the “Allow This Entry” checkbox. Lastly, click on on “Save”. It’ll reserve Raspberry Pi’s present IP handle, making it a static IP.

dhcp server

5. In case, you’re unable to search out the MAC handle of your Raspberry Pi, open the Terminal on RPi and run ifconfig. Beneath “wlan0”, examine the worth of “ether”. That’s the MAC handle of your RPi.

mac address

7. Lastly, restart your router, and Raspberry Pi will now all the time be allotted the identical IP handle that you simply reserved in your router.

Assign a Static IP Deal with to Raspberry Pi in a Few Straightforward Steps!

So that’s set a static IP handle in your Raspberry Pi with ease. This information might be of nice assist if you’re organising Pi-hole in your Raspberry Pi or pointing one other community system on your own home community to the mini-board. Anyway, that’s all from us. In case you are dealing with any issues, remark them down under and tell us. We’ll attempt that can assist you out.

Leave a Comment

Your email address will not be published. Required fields are marked *