Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Display Status: DHCP Leases with all 3 digits?

    DHCP and DNS
    4
    6
    197
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      TheWaterbug last edited by TheWaterbug

      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!

      johnpoz 1 Reply Last reply Reply Quote 0
      • johnpoz
        johnpoz LAYER 8 Global Moderator @TheWaterbug last edited by johnpoz

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

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 23.01 | Lab VMs CE 2.6, 2.7

        T 1 Reply Last reply Reply Quote 3
        • T
          TheWaterbug @johnpoz last edited by

          @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?

          ahking19 1 Reply Last reply Reply Quote 0
          • ahking19
            ahking19 @TheWaterbug last edited by

            @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)

            Screenshot 2023-03-13 at 6.07.59 PM.png

            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/

            1 Reply Last reply Reply Quote 0
            • jimp
              jimp Rebel Alliance Developer Netgate last edited by

              There is also the lazy method: Click the "IP Address" column header on pfSense to sort them before copying.

              Remember: Upvote with the ๐Ÿ‘ button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              T 1 Reply Last reply Reply Quote 1
              • T
                TheWaterbug @jimp last edited by

                @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!

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post