09-26-2024 12:17 PM
I'm having a devil of a time with this, in spite of numerous Google searches.
I have a Cisco Catalyst switch that is also a DHCP server. I want to view the lease duration of the DHCP pool I created.
I know how to *set* the lease duration, but I cannot for my life figure out how to *view* the lease duration. I know I can see the expiration dates of all active leases, but that's not what I'm looking for. I'm looking for the equivalent of "show me what I typed when I set the lease duration."
Solved! Go to Solution.
09-26-2024 02:52 PM
If you dont see any output in "show run | sec dhcp" or "show run | incl lease" then it indicates you have selected default lease time. In general default lease time is 86400 seconds which is 1 day.
09-26-2024 12:27 PM
Show dhcp binding
MHM
09-26-2024 12:33 PM
Thanks, but that's not it. That command shows the expiration dates of active leases, but it does not show what I typed when I set the lease duration. Obviously, I could deduce the duration by doing some math, but surely that's not necessary. What did I type when I set the lease duration?
09-26-2024 12:36 PM
Actually, the command "show dhcp binding" doesn't exist on this switch. I'm typing "show ip dhcp binding".
09-26-2024 12:41 PM
Show running | in lease
Check this
MHM
09-26-2024 12:44 PM
I don't get an error with that command, but it produces no output, I'm just returned the command line.
I'm getting the impression that there's just no way to view the lease duration directly, and that one must deduce it from the list of active leases. How odd for such a basic parameter.
09-26-2024 12:47 PM
You are correct
But what we can do we work with what we have
Did you try
Show run | in dhcp
MHM
09-26-2024 01:00 PM
Show run | in dhcp
That returns the names of my two DHCP pools, along with any excluded addresses, but not lease durations.
I suppose another way to know the duration is to re-set it. All this started because my server admin asked me the DHCP lease duration on our wireless network and I was confounded that I couldn't find a way to just look it up (I set it years ago). I figured looking it up would be a 15-second task. An hour later I just decided to set a new lease duration and gave him that number.
I do appreciate your effort.
Cisco...really? Come on.
09-26-2024 01:03 PM
Show run | sec dhcp
MHM
09-26-2024 01:38 PM
what is the device model and what IOS code running to guide to you better here.
Generally most device should work this commands - "show ip dhcp binding" and "show dhcp lease"
09-26-2024 01:47 PM
It's a Catalyst 9404R running IOS 16.09.02.
"show ip dhcp binding" does not return the least duration, it only returns active bindings, including their expiration datea, from which one must deduce the lease duration. All that is covered in the posts above this one.
"show dhcp lease" does not produce an error but also does not return a value.
09-26-2024 02:07 PM
show run | sec dhcp
is show all config under the dhcp pool include the lease time
MHM
09-27-2024 12:02 AM
It's a Catalyst 9404R running IOS 16.09.02.
Since we are not sure what device you using, so we are speculating the commands try and hit, since you mentioned the device and IOS XE code.
suggest to look the dhcp configuration : (depends on what you configured)
Step 16 |
lease {days [hours [minutes ]] | infinite } Example:
|
(Optional) Specifies the duration of the lease.
|
09-26-2024 02:52 PM
If you dont see any output in "show run | sec dhcp" or "show run | incl lease" then it indicates you have selected default lease time. In general default lease time is 86400 seconds which is 1 day.
09-27-2024 03:28 AM
Did you try "show run all | sec dhcp" or "show run all | in lease". If you don't include "all" keyword and you are using the default value of the lease then I don't think it will show up on the output.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide