Share via


Windows 2008 R2 DHCP Lease Duration

[問題描述]︰
 
依指令 netsh dhcp server set databasecleanupinterval 15
設定 DHCP Server , address pool 並未依設定每15分鐘進行清除與更新,

 
[解決方法]︰
 
新增機碼LeaseExtension以定期清除逾期的 IP address
 
[說明]:

 
1.      預設下,DHCP會在IP address租用過期4小時後,將此IP address標示為 [刪除] 狀態。
         此被設定為 [刪除] 狀態的IP address預設需經過1小時才會自DHCP database 被清除。
         但若環境中沒有足夠的可用IP可提供租用,也會立即清除以被認定為 [刪除] 狀態的IP。
3.      設定LeaseExtension  機碼會變更預設將租用到期的IP addres標示為[刪除] 狀態的時間。
         set databasecleanupinterval 則是變更清除[刪除] 狀態IP address的時間。

[如何設定]:
 
A.         請透過 [執行] > [regedit] > 找到下面的機碼位置:
            HKLMSystemCurrentControlSetServicesDHCPServerParameters
            新增機碼名稱:LeaseExtension
            Value Type: DWORD
            Value Data: time in minutes
 
[參考資料]:
 
Determining Lease Duration
https://technet.microsoft.com/en-us/library/cc783573(WS.10).aspx
 
Although reducing the lease duration creates more DHCP-related network traffic, it increases the rate at which addresses are returned to the available address pool for reassignment. With an average volume of DHCP request traffic, Windows Server 2003 DHCP has a four-hour default grace period after which an expired lease can be reused. This means that an address is marked for deletion four hours after the lease expires, regardless of lease duration. When the volume of DHCP-related traffic is heavy and no leases are available to service lease requests, DHCP immediately instantiates a cleanup cycle, which reclaims any leases marked for deletion. By default, the cleanup cycle occurs every 60 minutes. You can adjust the duration of the default grace period after which an expired lease is marked for deletion by editing the following key in the registry:

DatabaseCleanupInterval
https://technet.microsoft.com/en-us/library/cc963208.aspx

Description

Determines how often the Dynamic Host Configuration Protocol (DHCP) Service deletes expired ( doomed ) records from the DHCP client information database. By default, records expire after four hours. Deleting expired records releases space for new IP addresses.