4

UPDATED:

I recently built a new computer and set it up to dual-boot Windows 7 and Ubuntu 11.10.

In Windows, using the same hardware, my LAN connectivity is solid. In Ubuntu, however, my network interface periodically dies and resets itself; I'll have a solid connection for 30 seconds, and then it will go out for 30 seconds. When I tail the log:

tail -f /var/log/kern.log

I see "eth0 link up" messages appear periodically, corresponding with the return of connectivity.

I posted the original question months ago, and misinterpreted what was going on. With a working Internet connection in Windows, I ignored the problem for some months. See my answer below for the solution (drivers).

ORIGINAL POST

In Ubuntu, although I maintain a solid connection to my LAN (pinging the router IP address consistently returns a good result), my internet connectivity drops in and out. When I continuously ping 74.125.227.18 (a google.com server), I get responses for a while, then I start getting "Destination Host Unreachable" for a while, then I get responses again. This happens consistently, dropping the connection for about 30 seconds out of every minute or two.

Whether I configure my network via the network manager or via /etc/network/interfaces seems to make no difference. I configure with the following settings:

  • address 192.168.1.101
  • network 192.168.1.0
  • gateway 192.168.1.99 (my router's IP address)
  • netmask 255.255.255.0 (confirmed as the right netmask for the router)
  • broadcast 192.168.1.255 (also confirmed with the router).

ifconfig confirms that these settings are working:

eth0      Link encap:Ethernet  HWaddr 50:e5:49:40:da:a6  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::52e5:49ff:fe40:daa6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11557 errors:0 dropped:11557 overruns:0 frame:11557
          TX packets:13117 errors:0 dropped:211 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9551488 (9.5 MB)  TX bytes:1930952 (1.9 MB)
          Interrupt:41 Base address:0xa000

I get the same issue when I use automatic DHCP address settings, although I did confirm that there is no other machine on the network with the static IP address I want to use.

As I said, the connection to the local network stays solid - I never have any trouble pinging 192.168.1.* - it's internet addresses that I intermittently cannot reach. It's not a DNS issue because pinging known IP addresses directly shows the same behavior. Also, I don't think it's a hardware issue, as I never have any internet connectivity problems on the same machine in Windows. The network hardware is built into the motherboard: Gigabyte Z68XP-UD3P.

I managed to bring the OS fully up to date, according to the update manager, but it didn't fix the issue, and with my limited understanding of network architecture I'm at my wit's end. The only clue I can see is that ifconfig is reporting a lot of dropped packets, but I'm not sure what to do about it.

UPDATE: It seems my problem is a little more generic than I described; now when I try pinging my router and google simultaneously, they both go unreachable at the same time. Running ifdown eth0 and then ifup eth0 brings it back temporarily; if I just wait it comes back after a couple of minutes. I'll broaden my search through intermittent network connectivity problems.

6 Answers 6

8

The solution was to install the proper drivers for my ethernet adapter, which is built into my motherboard. I checked the model and version of my adapter, and the version of my Linux kernel:

$ lspci | grep Ethernet
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
$ uname -r
3.0.0-15-generic

then went to the driver download page for the manufacturer:

http://www.realtek.com/Downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=fa

and downloaded the driver that matched best. I was a little hesitant since uname reported a more recent kernel version than the drivers explicitly support, but I installed it with the autorun command in the downloaded package and everything seems to run fine.

Moral of the story: don't assume as I did that Linux comes pre-packaged with all the drivers you'll need.

2
  • Still working with kernel 3.8.0-35-generic Ubuntu Precise, exactly as advised above. Jan 11, 2014 at 13:27
  • I had the exact same problem, 2 years later. Different revision of the hardware (04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)) and a newer kernel (3.13.0-29), but this solution has worked for me as well. EDIT: Nope, nevermind. Did not solve it for me. :( Jun 6, 2014 at 8:26
3

It can be several things:

  1. disk hardware failure, like I/O errors, can cause net to go off because it fails to store data from browser.

  2. firewall blocking traffic, should have a rule to allow out tcp 25,53,80,110,443 and also allow out udp 53.

  3. if you have multiple firewalls programs, running simultaneous, that can also became a problem, like ufw and gufw, it is better to use only gufw...

2

I just ran into a similar problem. In my case, ifconfig showed no dropped or overrun packets, but 'route' showed a bogus route through a broken wlan0 device:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    100    0        0 wlan0
link-local      *               255.255.0.0     U     1000   0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     1      0        0 eth0

Doing 'sudo ifconfig wlan0 down' worked around the problem for me.

I filed https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/917399 for this.

1
  • This seemed like a promising avenue, so I tried it. I checked route when the connection was good, and everything seemed normal. However, when the connection went bad, I ran route and it did nothing for a while, and only came back with results (again, normal results) when the connection came back... Feb 12, 2012 at 15:53
0

I had a very similar problem to yours and found the answer here: http://www.avsforum.com/avs-vb/showthread.php?p=21371318 I turned off my PC and unplugged it for a few minutes then pressed the power button for a few seconds, still unplugged, and let it sit for a few more minutes and then plugged it in and powered it back on. It worked! No more intermittent connectivity issues! I would have never have guessed that discharging your capacitors would fix intermittent connectivity issues with ethernet but I will also not look a gift horse in the mouth, lol. My problem was really similar except I have an AMD and Asus motherboard build, but everything else was the same, or very similar, including my test results. Let me know if that works for you because other people are having the same issue and this is the first Google result for "intermittent connectivity ubuntu 11.10" that's relevant to this problem. If the Ubuntu gods read this I would humbly love to know why this solution works and what the problem is specifically?-D Best regards to all.

2
  • Against all expectations, this seems to have fixed it. Since this was a recent build, I've had the case open (with power disconnected of course) a number of times since I first saw this problem, so this time I unplugged it, tried the power switch thing, and left it unplugged for a half hour. Haven't had connectivity problems since then. I don't understand how this could be related to Internet connectivity in Ubuntu and not Windows, and that makes me suspicious. When I don't understand what I did to fix something, I don't trust that it will stay fixed, so I'm gonna keep a close eye on this. Feb 12, 2012 at 16:54
  • Welp, after turning my computer off and back on, the problem is back, although now it appears the whole network connection is going out; I can't ping my router. This makes my problem a little more generic, so I'll broaden my search for general network failures. Feb 12, 2012 at 22:05
0

I have intermittent internet connexion using wifi,I just edited my connexion and checked use Ipv4 and deleted my wired connexion and It worked for me.I am using ubuntu 13.. I hope this will help others.

0

This is a ubuntu bug which has not been corrected.I figure out that this intermittent co nnexion is due to switching back and forth between wired and wireless connexion.So if you are using wifi just delete the wired connexion and vis versa.May be a flag is not set correctly in the program.

1
  • Do you have a link to the bug?
    – Seth
    Nov 6, 2013 at 4:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .