ifconfig eth0 shows packet errors

July 29th, 2009 | Linux |

Just a quick note on problem I came up against today.
I monitor one of my production servers (running Ubuntu 7.10 server) with Munin and through this I had noticed a lot of errors on network interface eth0.

I had a quick look with ifconfig eth0 to see what was going on. These were the lines of interest from the output:

RX packets:404933416 errors:0 dropped:0 overruns:0 frame:0
TX packets:501341708 errors:31383248 dropped:0 overruns:11 carrier:62766496

Obviously something is not right.
I spent a while reading through log files to no avail, this isn’t really my area of expertise so I gave in and contacted my hosting provider.

A Digiweb engineer got back to me very quickly advising me to check if the network interface was running at half-duplex.
I used ethtool to check this out:

john:~$ sudo ethtool eth0
Settings for eth0:
	Supported ports: [ TP MII ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	Supports auto-negotiation: Yes
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	Advertised auto-negotiation: Yes
	Speed: 10Mb/s
	Duplex: Half
	Port: MII
	PHYAD: 32
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: pumbg
	Wake-on: d
	Current message level: 0x00000007 (7)
	Link detected: yes

The interface was only running at 10Mb/s half-duplex.
It seems auto-negotiation of the link had failed.

john:~$ sudo mii-tool eth0
eth0: autonegotiation failed, link ok

I fixed this be turning off auto-negotiation and applying the desired settings to eth0 with the following command:

john:~$ ethtool -s eth0 speed 100 duplex full autoneg off

Then to make sure this is always done with the interface is being brought up I added that command to /etc/network/interfaces just after the iface line:

iface eth0 inet static
pre-up /usr/sbin/ethtool -s eth0 speed 100 duplex full autoneg off

Having done this, the error count on eth0 hasn’t increased. Job done.


Leave a Reply