0

Our DHCP server is not allocating addresses on one of our scopes. Statistics seem to show it's full:

enter image description here

However, I can see there are only 88 addresses in use. I can't see any errors in the system or applications logs. The DHCP log is empty.

What would cause this?

Update: There seem to be a significant number of weird entries in the scope. There's a whole bunch of unidentified clients (i.e. IP address but no hostname), and these seem to be in groups with duplicate MAC addresses, with some weird extra characters added on.

6
  • How are you seeing that there are only 88 addresses in use?
    – EEAA
    Sep 23, 2015 at 3:18
  • Under address leases in the scope. I exported it to Excel and did a count which was a bit too tricky to screenshot.
    – Matt
    Sep 23, 2015 at 3:24
  • Also confirmed this with an IP scanner
    – Matt
    Sep 23, 2015 at 4:10
  • You should rather check leases isntead, not IP addresses. I guess someone is holding all the leases. Did you, by any chance, use cloning for windows deploying ?
    – drookie
    Sep 23, 2015 at 5:14
  • 1
    DHCP Reservations count against the Scope usage. Have you checked to see if there are any DHCP Reservations?
    – joeqwerty
    Sep 23, 2015 at 11:47

3 Answers 3

0

Try below command as administrator.

netsh dhcp server scope (eg. 192.168.1.0) show clientsv5.

you will get the total number of the active clients.

This will be number used to calculate the "InUse". Don't be surprised to find entries with DHCP lease already expired.

0

Here is a PowerShell script that might help to release expired leases. which can sometimes free up IP addresses in a scope:

# Import the DHCP module
Import-Module DhcpServer

# Define the DHCP server and scope you want to work with
$DHCPServer = "YourDHCPServerName"
$ScopeID = "YourScopeID"  # e.g., 192.168.1.0

# Get the DHCP server
$Server = Get-DhcpServerInDC -ComputerName $DHCPServer

# Get a list of expired leases in the specified scope
$ExpiredLeases = Get-DhcpServerv4Lease -ComputerName $DHCPServer -ScopeId $ScopeID | Where-Object { $_.LeaseExpiry -lt (Get-Date) }

# Release the expired leases to free up IP addresses
foreach ($Lease in $ExpiredLeases) {
    $IPAddress = $Lease.IPAddress
    Write-Host "Releasing lease for $IPAddress"
    Remove-DhcpServerv4Lease -ComputerName $DHCPServer -IPAddress $IPAddress -ScopeId $ScopeID
}

# Close the DHCP server
$Server.Close()

Write-Host "Expired leases released."

And here is a PowerShell script to identify if you have rogue clients (which I suspect you have)

# Import the DHCP module
Import-Module DhcpServer

# Define the DHCP server and scope you want to work with
$DHCPServer = "YourDHCPServerName"
$ScopeID = "YourScopeID"  # e.g., 192.168.1.0

# Get a list of all DHCP leases in the specified scope
$AllLeases = Get-DhcpServerv4Lease -ComputerName $DHCPServer -ScopeId $ScopeID

# Create a dictionary to store MAC addresses and associated IP addresses
$MACAddressIPDictionary = @{}

# Iterate through the leases and identify MAC address duplicates
foreach ($Lease in $AllLeases) {
    $MACAddress = $Lease.ClientID
    $IPAddress = $Lease.IPAddress

    if ($MACAddressIPDictionary.ContainsKey($MACAddress)) {
        $MACAddressIPDictionary[$MACAddress] += ", $IPAddress"
    } else {
        $MACAddressIPDictionary[$MACAddress] = $IPAddress
    }
}

# Identify MAC addresses with multiple associated IP addresses
$RogueMACAddresses = $MACAddressIPDictionary | Where-Object { $_.Value -match "," }

# Print out MAC addresses and associated IP addresses for potential rogue clients
foreach ($MACAddress in $RogueMACAddresses.Keys) {
    Write-Host "Potential Rogue Client MAC Address: $MACAddress"
    Write-Host "Associated IP Addresses: $($RogueMACAddresses[$MACAddress])"
}
0

I recently worked on a similar issue, but on a Cisco Device. Ultimately, the problem was due to IP Conflicts and Clearing those Conflicts Resolved the Issue.

I'm not entirely sure if this is your problem, in particular, but it is worth looking into (to ensure that it's configured, at least).

Enable IP Address Conflict Detection on Windows DHCP Server: https://mushaaf.net/enable-ip-address-conflict/

You could also check your DHCP Lease Time and Lower it to say, 4 Hours, perhaps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .