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

    [SOLVED] Reset firewall hit counters?

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 3 Posters 2.0k Views
    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.
    • awebsterA
      awebster
      last edited by awebster

      Is there a simple way, without resetting states, to reset the firewall rule hit/traffic counters that are visible in Firewall > Rules?
      In the GUI?
      On the CLI?

      –A.

      K 1 Reply Last reply Reply Quote 0
      • K
        Konstanti @awebster
        last edited by Konstanti

        @awebster
        Hey
        Unfortunately, such a feature does not seem to be implemented in pfctl. But you can do it yourself by writing a simple program in C.

        If you want, I can send you the text of such a program or I can send you a compiled utility.

        Before the program starts

        3fe16026-4696-4ebc-8c3c-0533ba638612-image.png

        [2.4.4-RELEASE][admin@pfSense.localdomain]/tmp: ./pf_clrstat
        All per-rule statistics cleared
        [2.4.4-RELEASE][admin@pfSense.localdomain]/tmp: 
        

        After

        376c2157-bb5e-4484-a59a-d2aaf8626cbc-image.png

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

          You don't need anything other than pfctl -z

          before
          before.png

          [2.4.4-RELEASE][admin@sg4860.local.lan]/root: pfctl -z
          [2.4.4-RELEASE][admin@sg4860.local.lan]/root: 
          

          after
          aftter.png

          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 24.11 | Lab VMs 2.8, 24.11

          K awebsterA 2 Replies Last reply Reply Quote 2
          • K
            Konstanti @johnpoz
            last edited by Konstanti

            @johnpoz Yeah, you're right, I didn't see it

            1 Reply Last reply Reply Quote 0
            • awebsterA
              awebster @johnpoz
              last edited by

              @johnpoz Thanks, that's exactly what I was looking for!

              –A.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.