Link to home
Start Free TrialLog in
Avatar of ldvhai
ldvhai

asked on

Reset eth0 on Linux!

Hi All,

When I run ifconfig on the CentOS, information of eth0:

eth0   Link encap:Ethernet  HWaddr 00:0C:29:87:91:F9
          inet addr:192.168.102.111  Bcast: 192.168.102.255  Mask:255.255.255.0
          .....
          RX bytes:10623376070 (9.8 GiB)  TX bytes:97989127014 (91.2 GiB)

How can I reset these counters especially RX/TX packets? (I don't want to use "/etc/init.d/network restart")

Thks in advance,

LDVHAI.
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

I don't think this is possible, the counters are kept in the kernel if I'm not mistaking, resetting the counters would entail resetting the nic(s) hence loosing connection.

You can check if the driver is a kernel module by doing

#ethtool -i eth0
Avatar of ldvhai
ldvhai

ASKER

Thanks for your answer:

The information got from CentOS

[root@ldvhai ~]# ethtool -i eth0
driver: e1000
version: 7.3.21-k4-3-NAPI
firmware-version: N/A
bus-info: 0000:02:00.0
[root@ldvhai ~]#

Thks,
SOLUTION
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
service network restart

Open in new window


OR

ifdown eth0
ifup    eth0

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ldvhai

ASKER

Thanks for your anwser.
Avatar of ldvhai

ASKER

Thanks for your anwser.