Reenabling DHCP

What is the problem?
I set up this octopi server years ago with a static IP address, and I'd like to switch it back to acquire it's IP address from a DHCP server. I believe I have done everything correctly, but the octopi server is not automatically obtaining an IP address, and I have to force it to. Once I force it, it obtains the correct IP address. The problem is that I don't know how to make it do this automatically.

What did you already try to solve it?
I opened /etc/dhcpcd.conf and edited the interface lines, removing the static IP addresses to read:

interface wlan0

static ip_address=
static routers=
static domain_name_servers=

As far as I can tell, this is all that is required to reenable the DHCP client, however this did not work. When I reboot the system, it does not obtain an IPV4 address. I then have to run the command dhclient wlan0 -v to force the server to acquire an IPV4 address, and it correctly gets the IP address from the DHCP server. But I cannot seem to get it to automatically acquire an IP address - every time I reboot I have to rerun that command.

How do I make it automatically acquire an IP address from a DHCP server? Thank you!

The /etc/dhcpcd.conf on my RPi has the interface and all of the static lines commented out. (971 Bytes)


Remove all the static lines, completely they're no longer needed.
Have a look in the logs to see what errors you get when you start the dhcpcd service

1 Like

Yes, this was just what I was looking for, thank you!