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

    Interface counters netstat vs pfctl

    Scheduled Pinned Locked Moved webGUI
    3 Posts 3 Posters 3.8k 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.
    • dotdashD
      dotdash
      last edited by

      I was searching around looking for a way to zero the netstat interface error counters, which would be nice if you swapped a cable or whatnot and wanted to see if there was still a problem. Couldn't find a way.
      Anyway, I came across someone complaining about the 32 bit netstat traffic counters, and someone pointed out that pf uses 64 bit counters. So something like:
      pfctl -vvsI -i vr1
      will give you traffic stats that won't wrap at 4GB.
      So, would it be feasible to query pf instead of netstat to get rid of the 4GB wrapping 'bug' on the interface counters?

      1 Reply Last reply Reply Quote 0
      • D
        databeestje
        last edited by

        This seems quite valid, it should help for both the interfaces graph and the rrd graphs.

        Which leads me to think we need a input output error graph. That we could use quite well.

        I think I looked at it during one point but I am unsure if pf will reset the counters on filter reload. Easy enough to test ofcourse.

        1 Reply Last reply Reply Quote 0
        • S
          sullrich
          last edited by

          Looks good.  I've commited support for it.  Seth is adding some other touches to it as well.  Thanks for the suggestion!

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