How can I reset the statistics reported by ifconfig?

I'm trying to trace a possible link problem on one of our servers' ethernet interfaces. ifconfig reports a large number of error packets. I've asked the hosting company to make some changes to the setup and would like to reset the interface counters to get a better idea if the situation has improved.

Restarting the machine is the obvious answer, but as this machine is the primary NAS, a maintenance window will be hard to acquire. Is it possible to reset the counters without a restart of the machine ?

Operating system is RedHat EL4, 32bit.


This question has been answered on SF already.

In short, the only way on a Linux box (at present) is to reload the network driver module, which may or may not be possible with your kernel configuration.


Let me add a remark why resetting network counters is a bad idea: It only works with a single reader.

A single reader knows that it has reset the counter and is able to deal with it. But if there are many different readers (e.g. monitoring plugins, snmp agents, etc) only the one that resets knows about it. All others will only see a sudden jump of the counter. That's bad.

Therefore, it's a good idea to offer a differential mode in programs which display these numbers. I.e. display the difference between the last counter reading and the current reading instead of displaying the absolute value of the current reading. Using this technique there often is no need to reset the counter.


It sounds like you can't.

You could just restart the network service and reload the driver. This would not be a full reboot. But you would still need a maintenance window, and a console/kvm session so you could reload the service.