The Pi boots up to the desired static ip(, but after a day it changes to a different subnet )

sudo vi /etc/dhcpcd.conf

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
interface wlan0
Static ip_address=
static routers=
static domain_name_servers=

Not sure what files to look into or what to change to prevent the IP from changing.

  • 1
    Have you associated this static IP with the Pi's MAC address on the router? It's the ultimate arbitrator, and if you have not it may decide not to comply with the request (or, more likely, at some point there will be some confusion and the address will end up changing).
    – goldilocks
    Mar 25, 2022 at 21:26
  • What Pi? What OS? What does ip a && ip r show?
    – Milliways
    Mar 25, 2022 at 21:26
  • 2
    Does this answer your question? How do I set up networking/WiFi/static IP address on Raspbian/Raspberry Pi OS?
    – Milliways
    Mar 26, 2022 at 4:17
  • 1
    You only show part of your dhcpcd.conf, your status IP address line has a capital letter, I would change that to lower case. Check for any interface fallback lines in the file too although I doubt this would be the issue given the name of this interface wlan0... No reason for it to change unless something else is invoking DHCP on the interface. Is this address inside the DHCP servers address range? Apr 1, 2022 at 10:27
  • Make sure you are only using WiFi or wired ethernet. You could be getting different addresses for each interface. You can check which interface is getting which IP address with: ip a
    – moo
    Dec 27, 2022 at 17:02

1 Answer 1


check on your router, if there is a static IP for the Pi. As long as the router does not know that the Pi should have a static IP, the router can still change it. The static IP is assigned to a MAC address. So it is also possible that your Pi is in the list of static IPs in the router, but in the meantime has a different MAC address. In this case, the MAC address would simply have to be updated. If you use a service like Pi-Hole, or an external DHCP server, then of course you have to check if the DHCP server in your router is marked as such, because only then the router knows that it should leave the DHCP stuff to another server.

Your Answer

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

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