How to compile r8168 and r8101 modules for Realtek ethernet adapters
quadrispro | July 8, 2008r8169 module has a lot of bugs and it doesn’t work well with a large number of Realtek’s adapters, so, a few days ago, I posted a patch for the Realtek r8101 module, which supports kernel 2.6.23 but not the 2.6.24, newest kernel in Ubuntu 8.04 «Hardy Heron».
This howto could be a solution for a large number of ethernet adapters issues.
The first step is downloading the right driver (r8101 or r8168) for the adapter:
- r8168 supports RTL8111B, RTL8168B, RTL8111, RTL8168 and RTL8111C;
- r8102 supports RTL8100E, RTL8101E and RTL8102E-GR.
Don’t try to compile the module now, it will not work, we need to apply a patch in order to make it working with Hardy’s kernel
Dowload in Home dir the patch for r8168 module or that for r8101, open a terminal and type these instructions to extract the tarball (I think it’s unnecessary, but filenames and paths could change, in according with the driver version):
cd ~/ tar -xvf r8101-1.007.00.tar.bz2 cd r8101-1.007.00/src
Now apply the patch to the r8168 sources dir:
patch < ~/r8168-8.005.00.hardy.diff.txt
Or, if you need r8101 driver, type this:
patch < ~/r8101-1.007.00.hardy.diff.txt
Finally, compile and install the module:
cd .. make clean modules sudo make install sudo depmod -a
To avoiding r8169’s loading at boot, create and open a new file, /etc/modprobe.d/blacklist-network:
sudo nano /etc/modprobe.d/blacklist-network
And add this line:
blacklist r8169
Finally, update the initial ramdisk:
sudo update-initramfs -u
At the next boot, your ethernet adapter will work really fine ![]()






I suggest not buying or using realtek cards at all.
Herman Bos | July 8, 2008 | 2:50 pmI suggest not buying or using realtek cards at all. Avoid like the plague.
Amazing what random behavior they can produce.
We normally stick with intel nics, something we do not regret. they most costs 40 euro more but thats definitely worth it.
[Reply]
I found it also useful to preserve the environment variables
Ste | July 8, 2008 | 7:47 pmI found it also useful to preserve the environment variables by using
sudo -E make
and yes realtek is a plague. It took me 3 weeks to figure out that the standard Linux driver could not resume the power status correctly.
[Reply]
[...] you read my previous article about r8169 module but
Alessio Treglia: Realtek’s modules, new version has been released | Christian eBuddy Blog | August 24, 2008 | 2:42 pm[...] you read my previous article about r8169 module but it wasn’t the best solution for your Realtek ethernet adapter, now [...]
[...] you read my previous article about r8169 module but
Alessio Treglia » Realtek’s modules, new version has been released | September 18, 2008 | 3:38 pm[...] you read my previous article about r8169 module but it wasn’t the best solution for your Realtek ethernet adapter, now [...]
It gives me this error.. what should i do? c@a:~/r8101-1.007.00/src$ patch
Constantine Tsardounis | October 28, 2008 | 5:34 pmIt gives me this error.. what should i do?
c@a:~/r8101-1.007.00/src$ patch < ~/r8168-8.005.00.hardy.diff.txt
can’t find file to patch at input line 4
Perhaps you should have used the -p or –strip option?
The text leading up to this was:
————————–
|diff -c ./r8168.h ../../r8168-8.005.00.new/src/r8168.h
|*** ./r8168.h 2008-01-09 05:27:22.000000000 -0800
|— ../../r8168-8.005.00.new/src/r8168.h 2008-04-14 15:20:55.000000000 -0700
————————–
File to patch:
[Reply]
Using the latest 8101 driver from Realtek (1.010) with Ubuntu
Brian Wilson | November 10, 2008 | 8:18 pmUsing the latest 8101 driver from Realtek (1.010) with Ubuntu 8.10 (kernel 2.4.27-generic) did not require your patch. The rest of your instructions are still accurate. Thanks for providing this information.
[Reply]