Recently, I have a problem with DHCP Server service run on Windows Server 2003 that use full ip address ranges, alot of IP used by strange mac address (3139…, longer than 12 charater) with type DHCP/BOOTP, even my DHCP server have mac address filter add-in and assign IP option is DHCP only. No special info in event log, Google return no clear root cause and solution.

Some strange address

this happen not just with Windows S2K3 also with S2K8 or 2012 too.

Before someone pointing out how we can fix this, I think I must live with it, here is my ideal and solution:

Create a program (with python or php), schedule run every 30 minutes to delete bad IP from DHCP server address leases, with help of netsh command from cmd.

First, fix and show all address leases in DHCP server database:

(example our scope is

The bad IP address with have type DHCP/BOOTP and not correct UniqueID/Mac Address

Second step, delete bad ip address:


PHP code:

You can see example code on Github here:

Hope this help.