• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

static IP address for Raspberry Pi board

Q&A Forum › Category: Raspberry Pi › static IP address for Raspberry Pi board
0 Vote Up Vote Down
marcjeanvandenbril asked 5 months ago

Hello everyone,
I’ve resumed studying your wonderful book “Smart Home Raspberry Pi”.
I would appreciate your advice on assigning a static IP address to the Raspberry Pi board, which is the heart of the system. My router sometimes changes it, forcing me to reprogram all the ESP312 and ESP8266 devices connected to it.
Thank you in advance.

6 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 months ago

Hi.
 
I’m sorry for taking so long to get back to you.
I’m currently on maternity leave and doing the best I can to keep up with work.
 
Unfortunately, we don’t have any guides about setting a static IP address for the Raspberry Pi. In our case, that was never necessary.
 
I found this guide that seems complete: maker.pro/raspberry-pi/tutorial/set-a-static-ip-on-raspberry-pi-with-nmcli
Let me know if you succeed.
 
We’ll try to investigate this subject soon and create our own guide about it.
 
 
Regards,
Sara

0 Vote Up Vote Down
Sara Santos Staff answered 5 months ago

There’s also this explanation on the official documentation, but it doesn’t seem very clear: https://www.raspberrypi.com/documentation/computers/configuration.html#assign-a-static-ip-address
 
Regards,
Sara

0 Vote Up Vote Down
William Lucid answered 5 months ago

Could use “router DHCP reservation“; if you are familiar with configuring a router from the router admin page.  Will need router user name (“admin” typically –not always and router password).

The better long-term fix is still the router DHCP reservation since it survives reflashing the Pi, OS reinstalls, etc. — nothing to reconfigure on the Pi side. Just needs the Pi’s MAC address:

Find mac address of the pi from a terminal:

ip link show eth0   # or wlan0 if on wifi

William

0 Vote Up Vote Down
marcjeanvandenbril answered 5 months ago

Thanks to Sara and Guillaume for their replies. I found a solution by configuring my router; it’s by far the simplest.
I’m taking this opportunity to share a little tip. Due to a malfunction, my router had to be replaced. However, it’s not possible to change the login/password on the SD card (at least, I don’t know how…). Simply insert a small file named “wpa_supplicant.conf” into the root directory of the SD card and write the following:
country=yours
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid=”yours”
psk=”yours”
}

0 Vote Up Vote Down
William Lucid answered 5 months ago

There is an amateur radio “pi-star” uitility that can be used to create “wpa_supplicant.conf”; when created –save to computer, copy the the root directory “boot”, just fill in SSID, Password, and Country.  Utility does the rest.

Pi-Star WiFi Builder

Regards,
William

0 Vote Up Vote Down
Sara Santos Staff answered 5 months ago

I’m glad the issue is solved.
William, thanks for sharing that tool. I was not aware of it. But, that can also be done manually, as we explain in this tutorial: https://randomnerdtutorials.com/installing-raspbian-lite-enabling-and-connecting-with-ssh/#set-up-wi-fi

I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Smart Home with Raspberry Pi, ESP32, and ESP8266 Version 1.7 November 28, 2025
  • [eBook Updated] Smart Home with Raspberry Pi, ESP32, and ESP8266 V1.6 September 9, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2026 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.