How do I clear the interface stats on Linux

Solution 1:

this is not intended, or think to be done. You may unload and load again the network driver if it's loaded as a module:

ifconfig ethX down; rmmod ethX; insmod ethX; ifconfig ethX

There will be a network outage anyway, and a risk if you can't get your hand back on it.

You may reset the switch port stats and check for new errors. Or save this current number and compare against them instead of zero

Solution 2:

Have you seen this article?

http://www.ducea.com/2006/09/08/resetting-ifconfig-counters/

It suggests that unloading the network driver module and loading it back will reset the counters, and that if you have the module statically linked in the kernel, there's no other way than to reboot it.

The article offers justification.