cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3957
Views
3
Helpful
14
Replies

How to view lease duration of a Cisco DHCP pool

RBenke
Level 1
Level 1

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."

1 Accepted Solution

Accepted Solutions

Parthiv Shah
Cisco Employee
Cisco Employee

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.

 

ParthivShah_0-1727387542175.png

 

 

View solution in original post

14 Replies 14

Show dhcp binding 

MHM

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?

RBenke
Level 1
Level 1

Actually, the command "show dhcp binding" doesn't exist on this switch. I'm typing "show ip dhcp binding".

Show running | in lease 

Check this 

MHM

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.

You are correct 

But what we can do we work with what we have 

Did you try 

Show run | in dhcp 

MHM

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.

Show run | sec dhcp

MHM

balaji.bandi
Hall of Fame
Hall of Fame

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" 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

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.

 

show run | sec dhcp 
is show all config under the dhcp pool include the lease time 

MHM

Screenshot (864).png

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:

Device(dhcp-config)# lease 30

(Optional) Specifies the duration of the lease.

  • The default is a one-day lease.

  • The infinite keyword specifies that the duration of the lease is unlimited.

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dhcp/configuration/xe-16-12/dhcp-xe-16-12-book/config-dhcp-server-xe.html

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Parthiv Shah
Cisco Employee
Cisco Employee

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.

 

ParthivShah_0-1727387542175.png

 

 

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.