Windows: Prevent from release a DHCP lease on shutdown


Windows by default releases the DHCP lease on shutdown. This is not useful if you often have to boot Windows and you want (if possible) the same IP Address Windows has before booting.

By default Windows interprets DHCP Option 2 submitted by the DHCP Server and if this is not set it release the lease.

You can change this behaviour:

Determine the of the Interface for which you want to alter this

PS c:\> Get-WmiObject -Query "Select Description,GUID from Win32_Networkadapter"|Select-Object Description,GUID
Description                                 GUID
-----------                                 ----
Intel(R) 82579LM Gigabit Network Connection {0694A535-03B4-4F63-A9C0-44565C8A881D}

Then add the following Registry Key ReleaseOnShutdown =0

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\{0694A535-03B4-4F63-A9C0-44565C8A881D} /v ReleaseOnShutdown /t REG_DWORD /d 0 /f

Possible other values are:
1: Always release the lease
2: Release or leave the lease depending of option 2 from the Server


Advertisment to support

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.