ifconfig can no logner collect stats for RX/TX packets by Linux kernel 6.6 or later
Linux networking base tools
Brought to you by:
eckes
I have a WSL2 on Windows 11 and it's Linue kernel:
6.6.87.1-microsoft-standard-WSL2
It installed Ubuntu :
Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble
Then recently net-tools was upgraded
ii net-tools 2.10-0.1ubuntu4.1 amd64 NET-3 networking toolkit
For now, all RX/TX packets are zeros by ifconfig
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.x.x.x netmask 255.255.240.0 broadcast 10.x.x.x
ether x:x:x:x:x:x txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
loopback0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether 00:15:5d:55:31:ab txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
However, although there are two different interfaces, but ip link can see the stats of RX/TX
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped missed mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
3: loopback0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:15:5d:55:31:ab brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
12733175 173235 0 2 0 11
TX: bytes packets errors dropped carrier collsns
19174566 103780 0 0 0 0
7: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether x:x:x:x:x:x brd ff:ff:ff:ff:ff:ff
RX: bytes packets errors dropped missed mcast
9945564262 3718021 0 0 0 0
TX: bytes packets errors dropped carrier collsns
28241290 246937 0 0 0 0
Does that mean ifconfig is obsoleted and out-of-date?
yes and no, net-tools is obsoleted by iproute2 and retired. however the function you mention normally works. i suspect that debian and ubuntu backported a (broken) security fix and forgot to add the regression fix commit
https://sourceforge.net/p/net-tools/code/ci/ddb0e375fb9ca95bb69335540b85bbdaa2714348/
if you can report it thrm to them that would be fine, otherwise i can try to do so. you can also tell them they missed more of the security fix commits.
it is now fixed by debian in bug#1106147 in dsa-5923-2