Navigation

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

    Command to count active DHCP leases

    DHCP and DNS
    2
    3
    1691
    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.
    • M
      Mypfsense2016 last edited by

      Hi all,
      I want to get the number of active DHCP leases. E.g: The DHCP IPs that clients are using and the DHCP server can't not reclaim yet.

      I use the following command. But it seems not accurate yet.
      grep active /var/dhcpd/var/db/dhcpd.leases | wc -l

      Any idea?
      Thanks a lot.

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

        If your wanting to keep an eye on the number of leases your using and such.. I would think you would want to turn on the graphing feature for dhcp.

        Or if you just go to status leases, at the bottom you can get a count from each dhcp pool - is that what your looking for?


        1 Reply Last reply Reply Quote 0
        • M
          Mypfsense2016 last edited by

          Normally, I only access pfsense remotely.
          Nevermind, I will see the code in the page you suggest and figure out how to count in batch shell.
          Thanks a lot.

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

          Products

          • Platform Overview
          • TNSR
          • pfSense
          • Appliances

          Services

          • Training
          • Professional Services

          Support

          • Subscription Plans
          • Contact Support
          • Product Lifecycle
          • Documentation

          News

          • Media Coverage
          • Press
          • Events

          Resources

          • Blog
          • FAQ
          • Find a Partner
          • Resource Library
          • Security Information

          Company

          • About Us
          • Careers
          • Partners
          • Contact Us
          • Legal
          Our Mission

          We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

          Subscribe to our Newsletter

          Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

          © 2021 Rubicon Communications, LLC | Privacy Policy