1

I've a DHCP server configured on Cisco 1602. Everything is working fine but after a client leaves the network it's IP address is still visible in "sho ip dhcp binding". Is there a way for DHCP server to remove the unused IPs from the database? For example a ping test once in a while or something like this. Or the only way is to decrease the lease time?

R2#sho run | se dhcp
ip dhcp excluded-address 10.0.0.1 10.0.0.154
ip dhcp excluded-address 10.0.0.158 10.0.0.254
ip dhcp pool 1
   network 10.0.0.0 255.255.255.0
   default-router 10.0.0.1
   dns-server 10.0.0.1
2

Theoretically, if the IOS version on your device supports EEM, you could write an EEM script that pings the IP addresses and releases them if there is no response.

However this would be much more complex, and I think it might cause duplicate IP scenarios in some corner cases where the router reclaims an address and the device still thinks its lease is valid.

In other words, yes I think it is (theoretically) possible but I don't see why this would be better than setting a very short lease time, so unless I'm missing the point it's not worth the trouble.

| improve this answer | |
1

Add the "lease 1" command to your dhcp pool. This will delete the IP address after 1 day if it's not used and no clients has send a renewal.

| improve this answer | |
  • The problem is I only have 3 IP addresses in the pool and when a phone for example leaves the wifi the DHCP server will not release the IP. If another device joins the network it might not receive new IP because all 3 is leased. Even when it is not used anymore. Is there any other way to check if an IP is used? If not, I'll probably decrease the lease time to 10 minutes. – human374 Oct 6 '16 at 7:48
  • 2
    @human374 the issue here seems to be the pool size rather than the dhcp lease. Surely you have a way to change / increase it... – JFL Oct 6 '16 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.