How can I get ubuntu network interface stats in the terabyte range?
When I query my server's network interface stats using either ifconfig
or ip -s
they're limited to 999GB and then roll over to 0GB, starting again. Is it possible to change the configuration somehow to allow stats logging in the terabyte range? Or use a different logging tool? I'm using Ubuntu 20.04.
$ uname -p
x86_64
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Many thanks.
Edit to add requested information. enp4s0
is the LAN side of my firewall and the total has only recently just reset back to 0GB. I'll provide updates in due course.
ifconfig output:
$ ifconfig enp4s0
enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.54.141 netmask 255.255.255.0 broadcast 192.168.54.255
ether 00:26:2d:24:91:43 txqueuelen 1000 (Ethernet)
RX packets 47559414 bytes 8105358582 (8.1 GB)
RX errors 0 dropped 9 overruns 0 frame 0
TX packets 126168339 bytes 183503412184 (183.5 GB)
TX errors 1 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18
ip outout:
$ ip -s -h link show enp4s0
4: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:26:2d:24:91:43 brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
8.11G 47.6M 0 9 0 3.38k
TX: bytes packets errors dropped carrier collsns
184G 126M 1 0 0 0
Both ifconfig
and ip
show stats in appropriate unit depending on the amount of data to be displayed. Can you provide outputs showing before and after unit rollover?
Here's output from Ubuntu 16.04.4 x86_64 server:
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
$ uname -p
x86_64
ifconfig output
$ ifconfig enp94s0f1
enp94s0f1 Link encap:Ethernet HWaddr 28:ac:9e:e7:a9:cd
inet addr:196.196.195.10 Bcast:196.196.195.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11694856562 errors:0 dropped:38446 overruns:0 frame:0
TX packets:10658263823 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6448839112903 (6.4 TB) TX bytes:4392568782445 (4.3 TB)
ip output
$ ip -s -h link show enp94s0f1
3: enp94s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 28:ac:9e:e7:a9:cd brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped overrun mcast
6.45T 11.7G 0 38.4k 0 0
TX: bytes packets errors dropped carrier collsns
4.39T 10.7G 0 0 0 0