cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3435
Views
0
Helpful
4
Replies

Automatically Resetting DHCP Leases

stephen.pugh2
Level 1
Level 1

I am setting up a DHCP scope on a Cisco 4500X.  The DHCP will service new clients and provide a PXE boot set of options.  Once built the client will access a Windows based DHCP service.  

I understand that the minimum DHCP lease duration is 1 day (24 hrs?). My question is, how can I clear the DHCP leases on a more regular basis say every 4 hours allowing me to use a smaller network IP range for the build network?  

Thanks in advance!
Steve

2 Accepted Solutions

Accepted Solutions

Marvin Rhoads
Hall of Fame
Hall of Fame

Try "clear ip dhcp binding". You can specify only a specific address or all ("*")

Reference

View solution in original post

Glad to hear that worked.

It looks like the 4500X IOS-XE does include support for the kron command scheduler utility.

I've not used it personally but from the configuration guide, it looks like you should be able to do something like:


!
kron policy-list ClearBindings
cli clear ip dhcp binding
!
kron occurrence ClearDHCP in 04:00 recurring
policy-list ClearBindings
!

Let me know if it works for you.

View solution in original post

4 Replies 4

Marvin Rhoads
Hall of Fame
Hall of Fame

Try "clear ip dhcp binding". You can specify only a specific address or all ("*")

Reference

Hi Marvin

That worked, thank you.  Would you know how I could possibly automate this command to run every 4 hours?  Kron job perhaps?

Cheers,

Stephen.

Glad to hear that worked.

It looks like the 4500X IOS-XE does include support for the kron command scheduler utility.

I've not used it personally but from the configuration guide, it looks like you should be able to do something like:


!
kron policy-list ClearBindings
cli clear ip dhcp binding
!
kron occurrence ClearDHCP in 04:00 recurring
policy-list ClearBindings
!

Let me know if it works for you.

Thanks again Marvin.  This will do the job nicely. 

Review Cisco Networking for a $25 gift card