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 279 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

      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
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by stephenw10

        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 Reply Quote 0
        • C
          ChrisJenk @stephenw10
          last edited by

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

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