19

want to see an amount of traffic passed through interface since boot. It's an ISPManager VDS with FreeBSD 8.0, and

ifconfig -L epair521b -B

does nothing.

Want to have output like Linux's ifconfig:

lo Link encap:Local Loopback
...

RX bytes:6642443661 (6.1 GiB) TX bytes:6642443661 (6.1 GiB)

kagali-san
  • 1,734

2 Answers2

35
systat -ifstat 1

Is much better. You gonna get traffic throughput, Peak and Total.

slhck
  • 235,242
Mathieu
  • 366
7

Reading file /usr/local/share/munin/plugins/if_ (in port sysutils/munin-node) I see it's using the following command line to achieve just that :

/usr/bin/netstat -i -b -n -I $INTERFACE

PS: that file also contains a warning that those are 32 bit counters; some years ago I RTFS and verifier that's because it's easier to update atomically; I didn't verify if it's the same on the (more recent) amd64 platform though.

lapo
  • 423