I’m having a real problem with the built in network card on my home linux machine (currently running Ubuntu 8.04 LTS server or affectionately named Hardy Heron).
There’s a couple of proviso’s attached to this howto, the first one being that if Ubuntu release a new Kernel as an update, you may have to re-run this fix, or if the old Realtec driver (r8169) gets fixed in the new Kernel , you may want to unblacklist that module and run with that.
Current Kernel version:
billy@orion:~$ uname -r 2.6.24-23-server
The symtoms are:
- Very bad download and upload speeds
- Huge amounts of dropped RX packets
Output from ifconfig below:
billy@orion:~$ ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:30:18:a8:93:4d inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::230:18ff:fea8:934d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:46909802 errors:0 dropped:345543907 overruns:0 frame:0 TX packets:34564243 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2672691663 (2.4 GB) TX bytes:1478308929 (1.3 GB) Interrupt:221
As you can see below, lspci correctly identifies my Network card as Realtek RTL8101E NIC.
billy@orion:~$ lspci | grep Rea 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E PCI Express Fast Ethernet controller (rev 02)
My home server is currently running the r8169 stock driver supplied with Hardy Heron. After doing some research, I discovered that the best way to solve the problem is to replace stock Kernel driver with one supplied by the network card manufacturers Realtek. So I’m going to replace the currently loaded driver r8169 with the driver supplied by Realtek (r8101).
lsmod | grep r81 r8169 33028 0
Since I’ve not installed anything from source on this server (vanilla server), I’ll need to install the linux header files and essential tools.
sudo apt-get install linux-headers-$(uname -r) sudo apt-get install build-essential
Next we need to download the drivers from the Realtek ftp site:
ftp://210.51.181.211/cn/nic/r8101-1.012.00.tar.bz2
After that we need to untar them, make and install them see steps below:
tar -jxvf r8101-1.012.00.tar.bz2 cd r8101-1.012.00 sudo su make clean modules make install depmod -a update-initramfs -u
You will need to add the r8169 module to the blacklist so that it doesn’t get reloaded after reboot, to do that type the following to edit the blacklist file.
nano /etc/modprobe.d/blacklist
Add the following text at the bottom of the file and save.
blacklist r8169
Now we need to reboot the fileserver and hopefully all will be well.
shutdown -r now
After the reboot, best to check if the module has loaded successfully type:
lsmod | grep r81
You should get the output below if you are successfull
r8101 36368 0
You can also check to make sure that the eth0 interface has come up successfully by using the command below.
ifconfig eth0
If all goes well, you should get output similar to what I got below, note that now I have no more dropped RX packets:
eth0 Link encap:Ethernet HWaddr 00:30:18:a8:93:4d inet addr:192.168.1.15 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::230:18ff:fea8:934d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3559288 errors:0 dropped:0 overruns:0 frame:0 TX packets:2539703 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:406768903 (387.9 MB) TX bytes:497335487 (474.2 MB) Interrupt:17 Base address:0x2000
Optional:
You might want to check to make sure that your ethernet card is running at the correct duplex and speed using ethtool. To do this type the following at a command prompt (shell).
sudo ethtool eth0
As you can see from my output, all is well in the world of home linux for me
Settings for eth0: Supported ports: [ TP ] 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: 100Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: on Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000033 (51) Link detected: yes
Below are some of the references I used to write this mini-howto.
References:
http://ubuntuforums.org/showthread.php?t=782267
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/322916
http://forums.debian.net/viewtopic.php?t=28371
http://www.linuxquestions.org/questions/linux-hardware-18/need-help-installing-driver-for-ethernet-card-658674/?highlight=RTL8101E
http://www.logicsupply.com/blog/2008/09/22/ubuntu-8041-and-the-d945gclf-little-falls/
http://en.alessiotreglia.com/articles/how-to-compile-r8168-and-r8101-modules-for-realtek-ethernet-adapters/