• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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.
  • A
    awebster
    last edited by awebster Oct 9, 2019, 4:33 PM Oct 8, 2019, 9:40 PM

    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 Oct 9, 2019, 5:37 AM Reply Quote 0
    • K
      Konstanti @awebster
      last edited by Konstanti Oct 9, 2019, 5:37 AM Oct 9, 2019, 5:37 AM

      @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
      • J
        johnpoz LAYER 8 Global Moderator
        last edited by Oct 9, 2019, 10:32 AM

        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 A 2 Replies Last reply Oct 9, 2019, 10:34 AM Reply Quote 2
        • K
          Konstanti @johnpoz
          last edited by Konstanti Oct 9, 2019, 10:46 AM Oct 9, 2019, 10:34 AM

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

          1 Reply Last reply Reply Quote 0
          • A
            awebster @johnpoz
            last edited by Oct 9, 2019, 4:32 PM

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

            –A.

            1 Reply Last reply Reply Quote 0
            1 out of 5
            • First post
              1/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received