The Issue
This post could very well be titled “How to install Linux on a Lenovo IdeaCentre Q180.” It was the purchase of one of the Lenovo IdeaCentre Q180 devices that triggered my quest to find the solution to the data packet loss I was experiencing. The Q180 comes with Windows 7 pre-installed which is a great Operating System to use as a media centre, but I had plans to turn the Q180 into a super-tiny test web server and Subversion/Git repository which definitely requires Linux.
The installation of Ubuntu Server 11.10 on the machine goes without a single hitch and the OS itself functions (almost) perfectly. It was when I tried to connect to the Internet or to SSH into the server from my laptop that the packet loss issue became most apparent. In fact, my SSH connection would die after 20 seconds requiring me to restart the session – at times it even required a reboot of the Server itself.
To test the connection, I would begin a continuous ping from my laptop to the Server’s IP address. Initially the ping would return a steady response but after about 20 – 30 seconds I would get “Destination host unreachable” as a response. The ping would then sporadically get a response before the host would be unreachable again. This unstable connection immediately kills any SSH session.
After much investigation (along with installs, re-installs, config changes and reading of websites) I found out that the Realtek 8168B ethernet controllers are actually incorrectly supported within the Linux kernel as far back as 2.4.x – I’m running Ubuntu Server 11.10 based on the 3.0.x Linux kernel myself.
So what exactly is the issue? It seems that during installation, Linux incorrectly installs the drivers for the Realtek 8169 ethernet controller which allows the 8186 to function but barely. The level of communication is akin to me using my Afrikaans to become a Dutch translator – I’d get the basics right but with a lot of problems along the way.
The Solution
The solution, in hindsight, is painfully simple – simply uninstall the 8169 driver and install the Realtek RTL8168 drivers.
Firstly, confirm you actually have the r8168 controller. (I recommend running all commands as root).
lshw -short
If so, you’ll need to download the latest driver from the Realtek driver website. Alternatively, run the following command in your Home directory:
wget http://r8168.googlecode.com/files/r8168-8.026.00.tar.bz2
Next we need to remove the r8169 drivers from the kernel.
rmmod r8169
Now we get to the good bit – compile and install the Realtek r8168 drivers:
tar xvf r8168-8.026.00.tar.bz2
cd r8168-8.026.00/
sudo modprobe -rfv r8169
sudo make
sudo cp src/r8168.ko /lib/modules/$(uname -r)/kernel/drivers/net/
sudo depmod -a
sudo modprobe -v r8168
Confirm everything went as planned and the driver is installed.
lsmod | grep r8168
You now have to blacklist the r8169 driver by editing /etc/modprobe.d/blacklist.conf and inserting
blacklist r8169
Test the success by rebooting your server and pinging it from another machine. This is how I tested it and after updating the driver my ping returned a consistent response. In fact, the response was much quicker as the r8169 driver also capped the ethernet controller at 100MBits.


Hi,
Thank you – problem with my ubuntu was solved
King regards,
Bartek
I’m glad my hours of research and frustration saved you the same
Enjoy your new Ubuntu install.
you wrote rmmod 6189
you mean rmmod 8169?
I did indeed! The post is now updated.
Thanks for pointing out that typo.
Hello dbz,
have you perhaps tried any newer kernels on this IdeaCenter? I’m currently trying to make it work with linux 3.2.9 + r8168-8.028.00 but the behavior is basically very similar to r8169.
You are the man, this has been a problem for a week, but thanks to you I solved it in 5 minutes. Not only was the writeup concise but it also worked unlike many solutions out there. Originally in ifconfig:
RX packets:90412 errors:0 dropped:90412 overruns:0 frame:90412
Now,
RX packets:90097 errors:0 dropped:0 overruns:0 frame:0
Thanks!!!
Thanks man!
You saved my day. This was a real issue. Ubuntu should fix that immediately.
Cheers
Andy
Thanks! That solved a big issue!