1

I am trying to set up a static IP lease on Raspberry Pi 5. The /etc/dhcpcd.conf file does not exist and dhcpcd is not installed. Following the latest guides does not work. I ideally don't need to use DHCP, but if there's a way that works with either option I'm open to suggestions.

I'm starting to wonder whether the Pi 5 been set up correctly.

I am unable to install any packages since I do not have internet. Is there any long lasting method that could work?

4
  • Use sudo nmcli dev wifi connect <network-ssid> or with password protection sudo nmcli dev wifi connect <network-ssid> password <network-password> or do that without showing the password with sudo nmcli --ask dev wifi connect <network-ssid>. Or use the graphic option sudo nmtui.
    – Dougie
    Nov 6 at 13:57
  • I'm surprised the usual crew didn't jump on the use of "Raspbian" which hasn't existed for over 3 years :p Nov 6 at 23:00
  • @JaromandaX haha! I haven't used RasPi OS in years, I didn't know it had changed name.
    – Joe Moore
    Nov 7 at 13:27
  • Does anyone read the details of the release bookworm-the-new-version-of-raspberry-pi-os before posting?
    – Milliways
    Nov 9 at 1:47

3 Answers 3

2

This is a useful guide, Raspberry Pi OS is basically Debian, with Bookwork being largely the same as the Debian Bookworm release. This guide was helpful for me. - https://itslinuxfoss.com/set-up-static-ip-address-debian-12-linux/

3

I see you've found an answer, so this is just FYI:

The people who run the RPi manufacturing operation decided to replace dhcpcd with nmcli as the default DHCP client program for the bookworm release. However, as I understand it, dhcpcd remains in the distribution (or certainly available for the price of a sudo apt install dhcpcd), so you can continue to use it - at least for a while.

And since this is an "FYI" kind of answer, I'll opine that dhcpcd is a pretty good DHCP client. It's still actively maintained by Roy Marples, and recently upgraded to ver 10. I feel that part of the reason that dhcpcd fell out of favor with the RPi manufacturing consortium was that they (and Debian) let it languish... they decided to stick with version 8 instead of following the upstream releases. Why?... I don't know, you'll have to ask them.

If you decide you do want to stick with dhcpcd, you have a couple of options:

  1. Stick with the old-ish version 8.1.2.

  2. If you want the latest version (ver 10) you'll need to build it from source.

Finally, wrt to your comment, "I'm starting to wonder whether the Pi 5 been set up correctly.". Yeah - you're not alone. :)

4
  • Thanks for such an informative answer. Really helpful. Hopefully RPi can sort this out and we can all get back to the normal issues with networking!
    – Joe Moore
    Nov 7 at 13:29
  • You're welcome. One question out of curiosity: your question said "dhcpcd is not installed". Can you confirm that? I recall reading that the RPi folks were going to leave dhcpcd in the distro, but disable it (maybe you have to use raspi-config to enable. it??)
    – Seamus
    Nov 7 at 14:07
  • 1
    They did not "replace dhcpcd with nmcli" - "they" adopted NetworkManager (used by most distos) which has a CLI interface nmcli
    – Milliways
    Nov 8 at 8:43
  • @Milliways: When a default software tool/service is changed by the owners of the software distro, I call that a replacement. You can call it whatever you like.
    – Seamus
    9 hours ago
0

The first Raspberry Pi OS that supports Raspberry Pi 5 manages the network settings by default with NetworkManager, as per https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/

To set a static IP of 192.168.1.50:

$ nmcli connection modify help
[...]
Examples:
nmcli con mod em1-1 ipv4.method manual ipv4.addr "192.168.1.2/24, 10.10.1.5/8"

$ nmcli con show
NAME                UUID                                  TYPE      DEVICE 
Wired connection 1  aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa  ethernet  eth0   
MyWiFi              bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb  wifi      wlan0  
lo                  cccccccc-cccc-cccc-cccc-cccccccccccc  loopback  lo     

$ nmcli con show "Wired connection 1" | tee original_network_settings.txt

$ sudo nmcli con mod "Wired connection 1" ipv4.method manual ipv4.addr 192.168.1.50/24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.