Realtek 8168 module issue

My cute little dual-core atom system (D945GCLF2) had a small hiccup with Debian. The kernel kept loading on boot the r8169 (incorrect) module for the onboard network device, which caused all sorts of weird phenomenon including, but not limited to, strange tasting coffee, distracted cats, ifconfig showing seemingly random numbers for dropped frames every time and not obtaining IP from DHCP servers occasionally.

The high-level solution is to replace the incorrect module with the appropriate one. Here goes:

  • Obtain the correct module (r8168)

Go to Realtek website and download the source for the latest driver.

Extract the archive:

tar -jxf r8168-x.y.z.tar.bz2

Prepare build environment:

apt-get install build-essential linux-headers-`uname -r`

Compile the driver source:

cd r8168-x.y.z
make clean modules && make install
  • Replace using the correct module

Before moving on, take note that removing the module for networking will disable the network interface. Which means any remote session running on the interface will be terminated.

Unload the current (incorrect) module:

rmmod r8169

Generate module dependency:


Load the correct module:

modprobe r8168

Update existing initramfs:

update-initramfs -u

If the kernel insists on loading the r8169 module, add the line blacklist r8169 into /etc/modprobe.d/blacklist:

echo blacklist r8169 >> /etc/modprobe.d/blacklist

(edited 18-07-2012, thanks to x in comments)
or, for newer distros:

echo blacklist r8169 >> /etc/modprobe.d/blacklist.conf

Hopefully all is good after going through the troubles.

p/s: My r8168.ko (Compiled for Lenny, 2.6.26-2-686) can be found under Resources.


20 thoughts on “Realtek 8168 module issue

  1. Pingback: Realtek 8169SC und Debian - Probleme bekannt? - Server Support Forum

  2. I recently assembled a server from a D510MO with the 8111DL and
    have experienced occasional ethernet controller lockups.

    I attempted to install the 8168 driver and the ethernet software appeared to function (I didn’t leave it running for long) but
    The machine would no longer shutdown properly (either halt or restart).

    I’m exploring the issue but I have to go back to the r8169 driver
    for now and put a watchdog script in place to kickstart the driver when it loses it’s way (ifdown followed by an immediate ifup).

    Any Ideas?


  3. got my nic working thanks to your walkthrough. still having the problem after reboot, but i am sure i will be able to fix that to.

    many thanks four your help

  4. Great article! Short and simple. I was having the same problem with D945GSEJT. When installing the driver do exactly as it is written in the article. I found the script inside driver package, but after running the module is still incorrect.

    Thanks a lot!

  5. The nic on my d945gsejt is now working (touch wood) thanks to your instructions.

    However it didn’t work first time, for me. Try as I’d like, the wrong module continued to be loaded, despite the blacklisting. I ended up repeating the process of

    rmmod r8169


    modprobe r8168

    update-initramfs -u

    then renaming /lib/modules/2.6.26-2-686/kernel/drivers/net.r8169.ko to r8169.koold to ensure it could not load. Than I shut down the pc, and removed the power lead from the box (which somebody on another blog page suggested)

    After that, success! Ifconfig showed eth0. And r8168 showed up in lsmod.

    I hope this further info might help somebody else.

  6. I’m on Ubuntu 11.10 (Kernel 3.0.0-17-generic) and the Realtek driver is for 2.6.X. I don’t know if that is the cause of my problem or something else but I’m dead in the water. FATAL: Module r8168 not found

  7. @Patrick: one cause of the “FATAL: Module r8168 not found” problem is running the above steps using sudo. Instead, run the above steps as root (i.e. issue a “sudo su” and then follow the above instructions).

  8. A big, huge, massive, epic THANK YOU for sharing this. From Ubuntu 11.04 onwards, I knew there was something “glitchy” about my wired network, but couldn’t quite pin point it. My VPN connections were unstable (to say the least) – intermittently disconnecting due to “bad GRE packets”. I had no idea what the problem was until I came across this post.

    Cannonical should be notified of this problem as it seriously damages the end-user experience in a manner that is neither obvious or easily identifiable. Users are simply left with the impression of “Ubuntu = flakey OS, everything works in Windows”.

    Once again – thank you.

  9. Pingback: Realtek RTL8111DL Driver Problems (Intel D510MO Motherboard) | Find Answer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s