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

Is there a way to get stats for an interface's IPv4 and IPv6 traffic from the command line?

Scheduled Pinned Locked Moved General pfSense Questions
3 Posts 2 Posters 277 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.
  • C
    ChrisJenk
    last edited by Jan 27, 2024, 2:09 PM

    I'd like to be able to get stats (bytes sent, bytes received) for a specific interface, broken out by IPv4 and IPv6, ideally from the command line. Is thsi possible?

    I looked at netstat -I <ifname> -b but the counters don't tie up at all, other than for the <Link#n> stats, which of course include IPv4, IPv6 and other stuff, so not suitable for my needs.

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by stephenw10 Jan 27, 2024, 10:57 PM Jan 27, 2024, 10:55 PM

      Try for example:

      [23.09.1-RELEASE][admin@fw1.stevew.lan]/root: pfctl -vvsI -i mvneta0
      mvneta0
      	Cleared:     Sun Jan 14 00:06:06 2024
      	References:  54                
      	In4/Pass:    [ Packets: 84261748           Bytes: 6404497380         ]
      	In4/Block:   [ Packets: 2473281            Bytes: 85666362           ]
      	Out4/Pass:   [ Packets: 116590050          Bytes: 38322442341        ]
      	Out4/Block:  [ Packets: 0                  Bytes: 0                  ]
      	In6/Pass:    [ Packets: 2472               Bytes: 180432             ]
      	In6/Block:   [ Packets: 120773             Bytes: 14138739           ]
      	Out6/Pass:   [ Packets: 2651156            Bytes: 1375467130         ]
      	Out6/Block:  [ Packets: 0                  Bytes: 0                  ]
      
      

      Of course that only works for traffic pf sees.

      Steve

      C 1 Reply Last reply Jan 28, 2024, 7:51 AM Reply Quote 0
      • C
        ChrisJenk @stephenw10
        last edited by Jan 28, 2024, 7:51 AM

        @stephenw10 Thanks! I think this may work for what I need. I will experiment...

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