Display Status: DHCP Leases with all 3 digits?
-
For various management reasons I occasionally copy/paste the DHCP lease table into Excel and sort, which gives me something like:
192.168.0.101 Hostname 192.168.0.11 Hostname 192.168.0.12 Hostname 192.168.0.14 Hostname 192.168.0.168 Hostname 192.168.0.171 Hostname 192.168.0.175 Hostname 192.168.0.18 Hostname 192.168.0.183 Hostname 192.168.0.184 Hostname 192.168.0.187 Hostname 192.168.0.19 Hostname 192.168.0.191 Hostname 192.168.0.193 Hostname 192.168.0.196 Hostname 192.168.0.197 Hostname 192.168.0.2 Hostname 192.168.0.20 Hostname 192.168.0.201 Hostname 192.168.0.209 Hostname 192.168.0.214 Hostname 192.168.0.217 Hostname 192.168.0.221 Hostname 192.168.0.226 Hostname 192.168.0.227 Hostname 192.168.0.236 Hostname 192.168.0.239 Hostname 192.168.0.243 Hostname 192.168.0.245 Hostname 192.168.0.3 Hostname
Is there a way to ask/force pfsense to display the last octet as a 3 digits, always, so that I get a logical sort in Excel?
I can write an Excel formula to do it, but that's wasted effort every time I need to do this.
Thanks!
-
@thewaterbug said in Display Status: DHCP Leases with all 3 digits?:
display the last octet as a 3 digits
Set your pool to only 100-254 ;) heheh
Curious - what exactly is the management function? Are you looking for how many leases are used or available in your pool? Are you wanting to know what device has what IP? And if that changes? Maybe there is an easier way to do what your wanting to do vs copy paste into excel?
You could put in a feature request, or you could prob edit the code that displays that in the status page to show with padding..
-
@johnpoz said in Display Status: DHCP Leases with all 3 digits?:
@thewaterbug said in Display Status: DHCP Leases with all 3 digits?:
display the last octet as a 3 digits
Set your pool to only 100-254 ;) heheh
I do have my pool set to 100 - 254. But I also want include reservations that start below 100.
Curious - what exactly is the management function? Are you looking for how many leases are used or available in your pool? Are you wanting to know what device has what IP? And if that changes? Maybe there is an easier way to do what you're wanting to do vs copy paste into excel?
Just as an example, I need to generate a list of all the PCs on my network and what version of OS they're running. The easiest way I could think of to take an inventory was to dump the DHCP lease table.
You could put in a feature request, or you could prob edit the code that displays that in the status page to show with padding..
Ah, I'm not much of a coder, unfortunately.
Does anyone else sort their IP lists?
-
@thewaterbug
Easiest way is to use Excel to split the IP into octets using the "Text to Column" function. Highlight your range and select Data tab, then Text To Column. Use Delimited with Other . (period as delimiter) and change the destination to a blank column, such as $C$1, so you don't over write your original IP data column.Then select all your data, A1:F30 for example, and then sort based on the column with 4th octet (column F)
Other option is to convert IP address so that each octet uses 3 digits. So 192.168.0.18 becomes 192.168.000.018
A Google search finds a formula to do this:
https://www.automateexcel.com/how-to/sort-ip-addresses/ -
There is also the lazy method: Click the "IP Address" column header on pfSense to sort them before copying.
-
@jimp said in Display Status: DHCP Leases with all 3 digits?:
There is also the lazy method: Click the "IP Address" column header on pfSense to sort them before copying.
There are not enough facepalms for me this morning.
I do this all_the_time and I didn't think about that before copying.
Thanks!