Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Networking & Wireless
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

Networking & Wireless
Having problems getting connected to the internet or getting your wireless card to work? Ask here.

 
Thread Tools Display Modes
Old December 26th, 2008   #1
nausicaavow
5 Cups of Ubuntu
 
Join Date: Dec 2008
Beans: 23
RTL8111/RTL8168 Network Connection Fix

This is guidance for those with integrated Realtek RTL8111 series gigabit Ethernet, built in to motherboards such as the ASRock G41M-LE.

Ubuntu 8.10 (and may other versions) have been reporting problems with connectivity. Here is the solution in a walk-through format. You must be root (sudo su -).

1) Check to see if the r8169 module is loaded
-> lsmod | grep r816
r8168 41104 0
-> lspci -v
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Subsystem: ASRock Incorporation Device 8168
Kernel driver in use: r8169
Kernel modules: r8169


2) Download the official Realtek driver
Realtek RTL8111/RTL8168

3) Remove the r8169 module
-> rmmod r8169
-> mv /lib/modules/`uname -r`/kernel/drivers/net/r8169.ko ~/r8169.ko.backup

( the ` is a backtick, it is not an apostrophe or single quote )

4) Build the new r8168 module for the kernel
-> bzip2 -d r8168-8.009.00.tar.bz2
-> tar -xf r8168-8.009.00.tar
-> cd r8168-8.009.00
-> make clean modules
-> make install


5) Rebuild the kernel module dependencies
-> depmod -a
-> insmod ./src/r8168.ko


6) Remove the r8169 module from initrd
-> mv /initrd.img ~/initrd.img.backup
-> mkinitramfs -o /boot/initrd.img-`uname -r` `uname -r`


7) Add r8168 module to /etc/modules
-> echo "r8168" >> /etc/modules

Reboot, You are done!

9) Examine that ONLY the r8168 module is loaded for the interface
-> lspci -v
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
Subsystem: ASRock Incorporation Device 8168
Kernel driver in use: r8168
Kernel modules: r8168


If you need to, configure your /etc/network/interfaces for dhcp or static address then `sudo ifup eth0`

Last edited by nausicaavow; December 31st, 2008 at 10:08 AM..
nausicaavow is offline   Reply With Quote
Old December 28th, 2008   #2
eombah
5 Cups of Ubuntu
 
Join Date: Jul 2006
Beans: 29
Re: RTL8111/RTL8168 Network Connection Fix

Thanks a lot, this saved me from buying a new network card for my brand new Dell Vostro 420.

One typo though:
Quote:
5) Rebuild the kernel module dependencies
-> depmod -a
-> insmod ./src/rr8168.ko
should be:
Quote:
5) Rebuild the kernel module dependencies
-> depmod -a
-> insmod ./src/r8168.ko
I guess I have to redo this for every kernel update that gets released?

-Bart

Last edited by eombah; December 28th, 2008 at 09:04 PM..
eombah is offline   Reply With Quote
Old December 30th, 2008   #3
nausicaavow
5 Cups of Ubuntu
 
Join Date: Dec 2008
Beans: 23
Re: RTL8111/RTL8168 Network Connection Fix

Yes, unfortunately this will have to be done for each kernel upgrade. Luckily, it takes only a few minutes.

Thanks I will update the post
nausicaavow is offline   Reply With Quote
Old December 30th, 2008   #4
Deflatarat
First Cup of Ubuntu
 
Join Date: Dec 2008
Beans: 2
Re: RTL8111/RTL8168 Network Connection Fix

Thanks for your post.

I am having trouble compiling the realtek driver. The directory:
/lib/modules/2.6.24-22-server/build
is missing on my system. The Makefile is trying to switch to that directory.

I am assuming that the driver tarball is expecting something in the build directory, probably kernel module sources. I already installed the linux-source-`uname -r` package. What package do I need to install?

I had to download individual .deb pkgs and transfer it to my linux box. Thank goodness for USB flash drives

Last edited by Deflatarat; December 30th, 2008 at 11:53 PM.. Reason: fix typo
Deflatarat is offline   Reply With Quote
Old December 31st, 2008   #5
Deflatarat
First Cup of Ubuntu
 
Join Date: Dec 2008
Beans: 2
Re: RTL8111/RTL8168 Network Connection Fix

I should have searched some more before posting. But if you install the following two packages, the build directory will be there.

linux-headers-2.6.24-22-server_2.6.24-22.45_amd64.deb
linux-headers-2.6.24-22_2.6.24-22.45_all.deb

Or sudo apt-get install linux-headers-`uname -r`, but my network was down

Replace version number with your `uname -r`. Mine was 2.6.24-22-server.
Deflatarat is offline   Reply With Quote
Old January 2nd, 2009   #6
cprofitt
Dark Roasted Ubuntu
 
cprofitt's Avatar
 
Join Date: Mar 2007
Location: Rochester, NY USA
Beans: 1,007
Ubuntu 9.10 Karmic Koala
Re: RTL8111/RTL8168 Network Connection Fix

Why is the default kernel not identifying the right driver?
cprofitt is offline   Reply With Quote
Old April 8th, 2009   #7
dargaud
A Carafe of Ubuntu
 
dargaud's Avatar
 
Join Date: Jun 2006
Location: Antarctica
Beans: 83
Kubuntu 9.10 Karmic Koala
Re: RTL8111/RTL8168 Network Connection Fix

Thanks, your instructions worked great. How can I figure out when the issue will be fixed in the kernel ? By looking at the replacement of r8169 by r8168 at kernel.org or somesuch ? I'd like to avoid updating my kernel until this is fixed, so if anyone knows for sure, a note here would be appreciated.
dargaud is offline   Reply With Quote
Old April 19th, 2009   #8
CFJ0
First Cup of Ubuntu
 
Join Date: Apr 2009
Beans: 4
Re: RTL8111/RTL8168 Network Connection Fix

I think that this should be included in Ubuntu 9.04 Desktop AND Server editions.
I am trying to run a server on a MB with Realtek RTL8111DL (ASRock G41M-LE) and its a pain to do this fix every time.
CFJ0 is offline   Reply With Quote
Old April 21st, 2009   #9
BubuXP
5 Cups of Ubuntu
 
BubuXP's Avatar
 
Join Date: Apr 2009
Location: Oriental Sicily
Beans: 17
Ubuntu 9.04 Jaunty Jackalope
Arrow Re: RTL8111/RTL8168 Network Connection Fix

Quote:
Originally Posted by CFJ0 View Post
I think that this should be included in Ubuntu 9.04 Desktop AND Server editions.
I am trying to run a server on a MB with Realtek RTL8111DL (ASRock G41M-LE) and its a pain to do this fix every time.
Today I installed 9.04 RC.
The motherboard is an Asrock G31M-GS with the same RTL8111DL NIC.
As expected, I had to install the r8168 driver because the r8169 driver included didn't work.
After installing and connecting, I made a system update and an updated kernel was in the list.
And surprise: the r8169 driver included in the new kernel is working out of the box!
I removed every r8168 reference from the system just to be sure and the network was still ok.
BubuXP is offline   Reply With Quote
Old April 22nd, 2009   #10
dargaud
A Carafe of Ubuntu
 
dargaud's Avatar
 
Join Date: Jun 2006
Location: Antarctica
Beans: 83
Kubuntu 9.10 Karmic Koala
Re: RTL8111/RTL8168 Network Connection Fix

This morning after a reboot and some hardware changes, I lost the ethernet. I could see both drivers in lspci -v: "Kernel driver in use: r8168, r8169"
One small thing to avoid the return of the bad driver, add the following line to /etc/modprobe.d/blacklist:
Code:
blacklist r8169
dargaud is offline   Reply With Quote

Bookmarks

Tags
r8168, r8169, realtek 8168, rtl8111

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:57 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry