How to disable DHCP Released at shutdown or reboot

Greetings!
Raspberry Pi4 4Gb
Onboard WiFi Adapter set to DHCP (tested with Wait for network on and off)
Version: 2023.12-1 Kodi 20.2

When it is shutdown or rebooted the OSMC submits a DHCP lease end to the DHCP service and gets a different IP at startup. See logs below.
Can this be behavior disabled?
Is there a shutdown script I can update?

It is the OS doing the release. My DHCP lease time is 180 days and the Pi I’m using had kept the same DHCP address with Rasbian for years.

I’m giving this to a family member and I’d rather it stay consistent on DHCP. If I set it to static then I’ll be doing home support should they change their network.

EDIT
I also installed openconnect VPN client and have tested with it disabled. Same result.
I use autofs to connect to the NFS share on the media server.

|2024/01/09 22:14:30 | lease-start | DHCP lease started ip 192.168.2.126 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 22:14:02 | lease-end | DHCP lease ended ip 192.168.2.125 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 22:09:49 | lease-start | DHCP lease started ip 192.168.2.125 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 22:09:20 | lease-end | DHCP lease ended ip 192.168.2.124 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 22:02:36 | lease-start | DHCP lease started ip 192.168.2.124 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 22:02:07 | lease-end | DHCP lease ended ip 192.168.2.111 → mac dc:a6:32:20:da:bf - hostname kypi |
|2024/01/09 21:18:55 | lease-start | DHCP lease started ip 192.168.2.111 → mac dc:a6:32:20:da:bf - hostname kypi |

Thanks!
Jon

You would need to do a static lease (mac/ip) on your DHCP server.

So if you have a new device you need to add it to the DHCP server

1 Like

Thanks for the suggestion. I was trying to avoid modifying the ISP provided router at her house.
It turns out I didn’t have to. I installed it this week and after reboots and shutdowns it kept the same IP.

It must be something between my DHCP server (running off a Palo Alto firewall) and OSMC. It is in fact proper to send a DHCP release at shut down but looking at my DHCP logs OSMC is the only OS that does it every time. Windows and other flavors Raspbian/Raspberry PI OS do not.

I have another OSMC Pi to build and might dig into it further just for curiosities sake. :thinking:.
I also found this article but OSMC does not have a “/etc/init.d/networking” file.
https://forums.raspberrypi.com/viewtopic.php?t=72579

Regards

That post is a decade old and we use ConnMan for network connectivity.

It could be modified to not relinquish the DHCP lease but I’d rather not do that,