Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My ethernet-based network connection doesn't stay up consistently. I'm running a ping against the gateway and it will:

  • Work for a minute
  • Freeze, time out, or give multi-second response times
  • Repeat

If it's stuck and I disable/enable networking through the network manager applet everything will work fine again for a minute. After 280 packets transmitted I'm getting 41% packet loss. I've tried a different cable and connection to the gateway but this had no effect. The distance to the gateway is just about 3 feet.

Seems to work fine if I switch over to Windows, but Ubuntu is my main OS and I can't even use it right now as I depend on the network.

My setup...

  • OS: Ubuntu 11.04, dual-booting Windows 7
  • Mobo: Gigabyte Z68X-UD4-B3
  • CPU: Intel Core i7 2600K

Edit

A little clarification... Network Manager is still showing me as connected, but I am unable to reach to gateway or anything beyond. At no point does NM suggest the connection is lost and calling ifconfig shows that I still have an IP address.

I tried connecting to a different gateway with a different cable and the same problem arises.

As requested:

lspci | grep -i eth
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

dmesg | tail -f
[   14.024709] EXT4-fs (sda5): re-mounted. Opts: errors=remount-ro,commit=0
[   14.026443] EXT4-fs (sda7): re-mounted. Opts: commit=0
[   14.176101] hda-intel: IRQ timing workaround is activated for card #2. Suggest a bigger bdl_pos_adj.
[   23.917731] eth0: no IPv6 routers present
[  726.109697] r8169 0000:07:00.0: eth0: link up
[  733.169494] r8169 0000:07:00.0: eth0: link up
[  753.930119] r8169 0000:07:00.0: eth0: link up
[  880.787332] r8169 0000:07:00.0: eth0: link up
[ 1159.161283] r8169 0000:07:00.0: eth0: link up
[ 1406.623550] r8169 0000:07:00.0: eth0: link up

Edit

@roland-taylor: Network is always available under Windows. Pings do not timeout, applications do not complain of no network availability, large downloads are not interrupted or slowed.

share|improve this question
2  
It's theoretically possible that the problem is with the gateway. Have you tried using a different gateway? –  Robin Green Jun 4 '11 at 18:10
2  
I don't think motherboard or CPU are of much interest here. lspci | grep -i eth might be more informatve, and which module is loaded, is dhcp running, what does dmesg | tail -f say from connecting to dropping the connection. –  user unknown Jun 4 '11 at 18:33
    
You say it "seems to work fine in windows" but are you really sure about that? –  RolandiXor Jun 5 '11 at 20:44
add comment

6 Answers 6

up vote 12 down vote accepted

Wake-on-lan after shutdown - this didn't work

BUT!!! i know how to fix it!!! it's not provider's fault it's broken r8169 driver!!!

here's the instruction:

Download the official realtek driver

http://www.realtek.com/downloads/downloadsView.aspx?Langid=1&PNid=5&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#RTL8111B/RTL8168B/RTL8111/RTL8168%3Cbr%3ERTL8111C/RTL8111CP/RTL8111D%28L%29%3Cbr%3ERTL8168C/RTL8111DP

then remove the r8169 module from the linux kernel.

# rmmod r8169


<Quick install with proper kernel settings>
Unpack the tarball :
# tar vjxf r8168-8.aaa.bb.tar.bz2
Change to the directory:
# cd r8168-8.aaa.bb
If you are running the target kernel, then you should be able to do :
# ./autorun.sh (as root or with sudo)
You can check whether the driver is loaded by using following commands.
# lsmod | grep r8168
# ifconfig -a
If there is a device name, ethX, shown on the monitor, the linux
driver is loaded. Then, you can use the following command to activate
the ethX.
# ifconfig ethX up

Finally, blacklist the r8169 driver add the following to /etc/modprobe.d/blacklist.conf:

#blacklist r8169 driver
blacklist r8169

i found it here

http://www.rvdavid.net/how-to-get-gigabit-speeds-from-rtl81118168b-pci-express-gigabit-ethernet-controller-on-ubuntu-linux/

and it works!!! now it's all good with net speed

share|improve this answer
    
This worked perfectly! My network connection is now stable and I've been able to continue the migration from my old desktop to this one. I'd vote you up but apparently I need more reputation... I would understand but it seems strange considering it was my question. –  Sean Hill Jun 27 '11 at 10:36
    
Thanks this helped, I can't get on the internet after rebooting though. There seems to be potential problems with the blacklisting the module. Theres more info in the comments on this post. –  Drew Jul 5 '11 at 19:53
    
to get on the internet after rebooting i followed some steps from here ubuntuforums.org/showthread.php?t=723569, except compiling from source –  dude Jul 8 '11 at 19:26
    
I updated to gnome3 and lost this module override, it looks like you need to go through these steps for every kernel update. I'm not sure what initramfs does, but I had not done that prior to updating. I ran it just now and it updated the boot ramfs for the current kernel, maybe it'll update for new ones too /cross fingers –  Drew Jul 14 '11 at 15:31
    
Are you using this? Do you notice these problems? There's hints here about automating the upgrade to new kernels with DKMS djlab.com/2010/10/fixing-rtl8111-8168b-driver-debian-ubuntu –  Drew Sep 22 '11 at 17:06
show 2 more comments

that may be usefull

you may experience the issues with the r8169 driver if you dual boot Windows on some systems. Windows by defaults disables the NIC at Windows shutdown time in order to disable Wake-On-Lan, and this NIC will remain disabled until the next time Windows turns it on. The r8169 driver in the kernel does not know how to turn the NIC on from this disabled state; therefore, the device will not respond, even if the driver loads and reports that the device is up. To work around this problem, simply enable the feature "Wake-on-lan after shutdown." You can set this options through Windows' device manager.

Edit: Problem with dual-booting with Windows exist also in 2.6.19.5 and 2.6.20.8 kernel, so it is safe to assume that it will concern all 2.6 kernels until the kernel developers update the drivers for RTL8168 to the version that will be able to turn on the NIC from disabled state

share|improve this answer
add comment

and one more thing - to make changes with driver constant and prevent starting r8169 again after reboot, i used this:

http://ubuntuforums.org/showthread.php?t=723569

share|improve this answer
add comment

Just so I can find this next time my SSD blows up. Here are instructions for removing the broken r8169 and inserting r8168 on Ubuntu w/Linux Kernel 3.x.

Kernel 3.x

  • Download r8168
  • Apply this patch if it is still marked unresolved.
  • STOP: If you plan to use DKMS, skip to the DKMS section now.
  • Run sudo ./autogen.sh, it will build the module, remove the old one (blacklist it if you want) and install r8168.ko to /lib/modules/'uname -r'/drivers/net/.

DKMS

DKMS will build and install the module upon new kernel installs. You will also need to blacklist the old module.

Blacklist the old module if you haven't already.

echo 'rmmod r8169' | sudo tee /etc/modprobe.d/blacklist.conf

Install DKMS, and gcc.

sudo apt-get install dkms gcc

Copy the module source files to a persistent location, so you don't accidently remove them later.

sudo cp -R r8168-8.025.00 /usr/src

echo 'PACKAGE_NAME=r8168
PACKAGE_VERSION=8.025.00
MAKE[0]="make"
BUILT_MODULE_NAME[0]=r8168
BUILT_MODULE_LOCATION[0]="src/"
DEST_MODULE_LOCATION[0]="/kernel/updates/dkms"
AUTOINSTALL="YES"' | sudo tee /usr/src/r8168-8.025.00/dkms.conf

Then run,

dkms add -m r8168 -v 8.025.00
dkms build -m r8168 -v 8.025.00
dkms install -m r8168 -v 8.019.00
sudo update-initramfs -u
share|improve this answer
1  
+1 great post. it's possible you are missing update-initramfs command –  bbaja42 Oct 17 '11 at 7:08
    
I've used that many times and never saw a difference, you sure this is needed for a network module? Actually, I'll just include it to be safe. I wrote the guide as I stepped through the process to make sure it all works. I may have previously ran this while module was build/installed/whatever though. –  Drew Oct 17 '11 at 17:17
    
Today I swapped routers after which the RTL8111E on a GA-Z68X-UD3H-B3 (running Kubuntu 11.10 64-bit) ceased to work: even if a network connection could be established, no packets were transferred (ping to router failed with "Destination Host Unreachable"). After make modules and inserting the module, it worked again. After rmmoding the new module, and loading the old one, the network worked again. This is also true after a reboot. I'm not sure what helped to get this NIC to work again (rmmod/insmod vs rmmod/insmod new module), but hopefully it's helpful to someone. –  Lekensteyn Nov 21 '11 at 14:58
add comment

Errata corrige:

echo 'blacklist r8169' | sudo tee /etc/modprobe.d/blacklist-r8169.conf
dkms add -m r8168 -v 8.025.00
dkms build -m r8168 -v 8.025.00
dkms install -m r8168 -v 8.025.00
sudo update-initramfs -u
share|improve this answer
    
Could you please add an explanation of what these commands are doing? –  Chris Wilson Nov 12 '12 at 12:47
add comment

I had a similar problem and I found a solution.

see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/889527

share|improve this answer
add comment

protected by Community Jan 25 '12 at 13:15

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.