Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So one of my clients configured one of their switches and the resulting configuration resulted in a duplex mismatch between the switch and a Linux host.

We have fixed the duplex mismatch, but is there an easy way to clear the error counters on the interface without restarting the system?

eth0      Link encap:Ethernet  HWaddr 00:nn:nn:nn:nn:nn
          inet addr:192.168.97.166  Bcast:192.168.97.167  Mask:255.255.255.252
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:630331763 errors:1 dropped:0 overruns:0 frame:0
          TX packets:676081436 errors:1971815 dropped:0 overruns:68637 carrier:1903180
          collisions:7649984 txqueuelen:1000 
          RX bytes:2067682611 (1.9 GiB)  TX bytes:1942809411 (1.8 GiB)
share|improve this question

2 Answers 2

up vote 11 down vote accepted

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

share|improve this answer
    
+1. Counters are, by their nature, supposed to be compared against their previous value, regardless of what that value was. –  womble Jun 10 '09 at 22:19

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.