Interface wlan0 take reserved dhcp ip at reboot, but change it after a while

  • Platform information: Raspberry5
    • openHAB version: openHABian 4.3.5

I made a ip reservation on my dhcp router for both eth0 and wlan0.

When rebooting the obenhabian both interfaces take there reserved ip - good so far.
Eth0 will hold it “forever” but after a while (<24h) wlan0 will change ip to the first free ip.
If I reboot the device at this point, same thing, it takes the reserved ip and loose it after a while.

Does anyone had the same issue and found a way to fix it?

thanks
René

If it was me chasing this and looking at all the logs for OS network manager and such did not give me any clues I would pop out the SD card grab a fresh spare one and blow a straight clean Raspberry Pi image on it and see if the behavior persists this would tell you if it was a hardware issue weak Wi-Fi(or interference) problem if it persists then look at router possible settings or a firmware upgrade may be needed. Some Wi-Fi routers tend to drop inactive Wi-Fi connections so power management could be triggering your Wi-Fi Nic to shutdown/sleep and router sees it as an inactive connection then drops it. router quirks or Rpi bugs should be straight forward to isolate if you rule out custom images and configurations there are lots of blogs on the Raspberry Pi site discussing various Wi-Fi network issues that talk a lot about losing Wi-Fi after a few hours seemed to be some resolved by upgrading kernel to 6.6 since a bullseye to bookworm upgrade is not recommended as it does not do a kernel upgrade in certain scenarios. Another thing you could try for testing is to continual ping the wlan0 ip and see if it stops changing when it is actively taking traffic (eliminates the power management possibility) is another possible troubleshooting step you might consider. One other test you might try is instead of rebooting the RPi try disabling then reenabling the wlan0 and see if it pulls the reserved IP again other than that without a network trace to see the dhcp ack request and responses it is a wild guess. without knowing what your dhcp router is doing but the only way the IP will normally change is because the RPi Nic discarded the existing IP assignment and then requested a new IP lease without sending an IP release first, so the router did not reissue the reserved IP as its lease was still considered active. You may also try reducing the lease time to a very low value and see if the behavior changes as well.