How can I manually reset RX / TX counters in ifconfig output without impacting data delivery?

155

This has already been answered by @SuB on Ask Ubuntu. I've adapted the answer for CentOS:

Those counters are kept by the kernel, so your answer depends on how your network card driver is built. Two possible choices:

  • As a kernel module
  • Built into the kernel file itself

In second case, you can not reset counters. In the first case, you can do it by unloading the module from the kernel and then loading it back again. If your NIC card uses the e1000 module, use the following commands:

ifconfig eth0 down
modprobe -r e1000
modprobe e1000
ifconfig eth0 up

Use ethtool to find out your NIC module:

ethtool -i eth0

After "driver" you see your module name:

driver: e1000
version: 7.3.21-k8-NAPI
firmware-version:
...

Use yum to install ethtool as follows:

yum install ethtool
Share:
155

Related videos on Youtube

getit
Author by

getit

Updated on September 18, 2022

Comments

  • getit
    getit almost 2 years

    I have TreeView control on a form for an application running on a Win 6.0 device with 2.0 SDK.

    On the device (touch screen) I tap a checkbox in the treeview, it flashes the correct check state, but then reverts. I can only check or un-check if I double click it.

    This problem does not occur when running in an emulator.

    I'll try to explain a little more clearly with an example:

    -a box is currently un-checked -user taps the checkbox (it is a touch screen device) -I see the 'X' appear briefly in that box, but then it reverts to its un-checked state -user double-taps the check box, it works.

    • getit
      getit about 11 years
      Found this answer here: stackoverflow.com/questions/1867944/…
    • a21
      a21 over 9 years
      I've seen this question before on askubuntu, the answer would be the same for you and can be found here: For short unloading / loading kernel module. But that would be somewhat intrusive to your network. So my guess is that you can't.
    • Mike B
      Mike B over 9 years
      @a21 agreed. :-/
    • Mike B
      Mike B over 9 years
      @a21 If you'd like, feel free to post an answer with that information.
  • user2948306
    user2948306 about 7 years
    You don't need to unload the module. You can unbind and rebind the driver since ~2005. lwn.net/Articles/143397