3

I randomly have the problem on my 15.04 that the Internet connection via LAN stops working. This often happens directly after boot, but sometimes also just in the middle of a surfing session without any special actions.

My applications (Firefox, Skype, ...) report no network access, and both ping google.com and ping 8.8.8.8 also give up, as well as pinging my router (ping 192.168.0.1).

What I do if this connection loss is happening is that I click on the network indicator and select "Disconnect", wait a second and reconnect the same connection. After this procedure everything seems fine again.
Today it also went away by itself after some minutes, but some more connection breaks followed.

How can I troubleshoot this problem? What do I have to observe when it occurs next time to give you the important information? How will I finally be able to prevent such connection losses or can I at least have a workaround that automatically detects and solves it?


Update 1:

$ sudo lshw -C network
  *-network               
       description: Ethernet interface
       product: 82573L Gigabit Ethernet Controller
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 00
       serial: 00:17:31:a1:f5:fa
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=2.3.2-k duplex=full firmware=0.5-7 ip=192.168.0.107 latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
       resources: irq:24 memory:cfee0000-cfefffff ioport:c800(size=32)

Update 2:

Content of /var/log/syslog around the time of the last connection failure:

Jul 12 16:14:23 MaxData-Desktop-Ubuntu kernel: [ 5298.718729] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:24:65:11:25:b0:0c:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Jul 12 16:15:07 MaxData-Desktop-Ubuntu whoopsie[670]: [16:15:07] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:15:07 MaxData-Desktop-Ubuntu whoopsie[670]: [16:15:07] offline
Jul 12 16:15:27 MaxData-Desktop-Ubuntu whoopsie[670]: [16:15:27] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:15:47 MaxData-Desktop-Ubuntu whoopsie[670]: [16:15:47] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:16:07 MaxData-Desktop-Ubuntu whoopsie[670]: [16:16:07] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:16:28 MaxData-Desktop-Ubuntu kernel: [ 5423.720176] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:24:65:11:25:b0:0c:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Jul 12 16:16:30 MaxData-Desktop-Ubuntu whoopsie[670]: [16:16:30] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:16:50 MaxData-Desktop-Ubuntu whoopsie[670]: [16:16:50] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:17:01 MaxData-Desktop-Ubuntu CRON[9122]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Jul 12 16:17:10 MaxData-Desktop-Ubuntu whoopsie[670]: [16:17:10] Cannot reach: https://daisy.ubuntu.com
Jul 12 16:18:33 MaxData-Desktop-Ubuntu kernel: [ 5548.718565] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:24:65:11:25:b0:0c:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Jul 12 16:20:38 MaxData-Desktop-Ubuntu kernel: [ 5673.717889] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:24:65:11:25:b0:0c:08:00 SRC=192.168.0.1 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Jul 12 15:12:48 MaxData-Desktop-Ubuntu gnome-session[6329]: message repeated 2 times: [ debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Keine Berechtigung]
Jul 12 16:21:53 MaxData-Desktop-Ubuntu gnome-session[6329]: (process:9144): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Jul 12 16:22:23 MaxData-Desktop-Ubuntu whoopsie[670]: [16:22:23] online
Jul 12 16:22:23 MaxData-Desktop-Ubuntu kernel: [ 5778.310686] [UFW BLOCK] IN=eth0 OUT= MAC=00:17:31:a1:f5:fa:24:65:11:25:b0:0c:08:00 SRC=198.252.206.25 DST=192.168.0.107 LEN=110 TOS=0x00 PREC=0x00 TTL=50 ID=50591 DF PROTO=TCP SPT=443 DPT=54409 WINDOW=33 RES=0x00 ACK PSH URGP=0 

Before and after this snippet are more [UFW BLOCK] lines, but they don't seem suspicious to me. I have similar lines in dmesg, but nothing more.

3
  • This is a @Serg question =). Some interesting entries in syslog?
    – A.B.
    Jun 30, 2015 at 9:32
  • @A.B. That ping won't work as he was not here yet. What do you mean by syslog? The output of dmesg? I'll have to wait until it happens again to provide that info, but I'll write it on my to-do list.
    – Byte Commander
    Jun 30, 2015 at 9:42
  • cat /var/log/syslog or you can access them using Log File Viewer from dash
    – Ron
    Jun 30, 2015 at 9:44

3 Answers 3

7

First, identify the driver for your network device with the command:

lshw -C network

Look for driver=.

Next, check the log for clues as to why the device disconnects. I suggest you look at both the driver and what Network Manager is doing:

cat /var/log/syslog | grep -e some_driver -e etwork | tail -n 20

Ideally, run this just as the internet connection has dropped.

Then I suggest you search this site and Google for your driver name and "disconnects" for possible solutions. You might also edit your question to add additional details and we'll be happy to assist.

If you wish to post your syslog result, as it will be lengthy, post it here and give us the link: http://paste.ubuntu.com

You have confirmed the infamous e1000e. There are several things you might try. The probable solution that seems to work often, but not always, is to disable gigabit speeds. You can try temporarily with:

sudo ethtool --change eth0 speed 100 autoneg off

If this is helpful, we will drop the parameters into rc.local to make them persistent.

8
  • Updated my question. As you expected, it's driver=e1000e driverversion=2.3.2-k.
    – Byte Commander
    Jun 30, 2015 at 13:21
  • Please see my edit in a few moments.
    – chili555
    Jun 30, 2015 at 13:29
  • 1
    chili555, i am very much fond of your networking solutions..i have two humble suggestions for you..to find the driver, you can use sudo lshw -C network | grep -Po '.*driver=\K[^ ]+(?= )' ..also in case of syslog, no need for extra cat, you can use grep -e some_driver -e etwork /var/log/syslog | tail -n 20
    – heemayl
    Jun 30, 2015 at 13:54
  • I can try this ethtool command, but how will I see whether it worked? As I said, it occurs randomly, maybe once in two days in average... And if I do this when the connection is already broken, it won't help any more, will it?
    – Byte Commander
    Jun 30, 2015 at 15:41
  • @ByteCommander: maybe when the connection is broken... ethtool --change eth0 speed 100 autoneg off will keep a 100Mb connection on your NIC until you reboot... so if you enter that command and it stops dropping out, it's an autonegotiation/speed issue... First things to check though is the cable. Have you tried with a different cable??? :P (chili555: physical layer first, then data-link! :D)
    – Fabby
    Jun 30, 2015 at 19:18
1

For whatever reason, these issues became rarer in recent time.

Besides that, whenever it occurs, I run the following command to disconnect and reconnect:

nmcli con down "CONNECTION NAME" && nmcli con up "CONNECTION NAME"

To speed typing up, I've created an alias for it, by appending the following line to my ~/.bashrc file:

alias reconnect='nmcli con down "CONNECTION NAME" && nmcli con up "CONNECTION NAME"'
1
  • BTW, on Wifi CONNECTION NAME is the SSID, the human informal name of the access point. Jun 7, 2017 at 19:50
-1

What you describe seems like dhcp lease issue. When you connect to the router, dhcp gives you ip for some particular amount of time ( that's what's called lease ), and then that gets renewed.

For example, here's what I have in my syslog:

$ grep 'renew' /var/log/syslog Jun 30 20:38:01 anaconda dhclient: bound to 192.168.43.209 -- renewal in 1342 seconds.

My assumption,then, is that you still have the IP, so your machine is reported as connected, but in fact the lease hasn't been renewed or has glitched/failed.

What I suggest is try switching the dhcp client that you're using. NetworkManager comes with dhclient by default, if I am not wrong. You can try to install dhcpcd (for other options check apt-cache search dhcp). Why I suggest this one is because man NetworkManager.conf says that's the supported one (along with the default one ,dhclient).

Then in /etc/NetworkManager/NetworkManager.conf you're gonna need this line dhcp=dhcpd , bellow [main]. For example,

[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
dhcp=dhcpcd

[ifupdown]
managed=false

I've had the issue like that where network icon says connected but in fact it's stopped working, but I've realized what's going on only recently, because I'm slowly learning about networking. I won't say that's 100% bulletproof solution, but that's what i can suggest. At least I haven't experienced this issue much after playing around with my dhcp client settings.

Also, try disabling ipv6, disable the n-channel wifi (if your card supports it), and power management as suggested in this article: http://itsfoss.com/speed-up-slow-wifi-connection-ubuntu/ These hacks mostly work for speed, but they won't hurt

6
  • 3
    All this is absolutely true, but with networking problems, you go bottom-up: first physical, then driver, then IP (where your solution lies) then TCP/UDP, then application... (upvoted already as someone else might be running into this, but if @chili555 is on it: listen and learn! ;-) :P
    – Fabby
    Jun 30, 2015 at 19:13
  • IPv6 is disabled and it's a LAN only card, no Wifi. I copied both answers to a text file and will check syslog etc when it happens again. Be patient, please... ;)
    – Byte Commander
    Jul 1, 2015 at 5:11
  • It just happened, but there was no line containing renew in /var/log/syslog, so I guess it was no DHCP failure?
    – Byte Commander
    Jul 12, 2015 at 14:53
  • @ByteCommander there should be renew line if everything works fine. So if it's missing, that seems not right. Can you investigate the syslog and perhaps other logs if there's entries from DHCP at all ? Jul 12, 2015 at 17:17
  • In fact there should be at least one renew entry , once you connect, it should give you time in seconds how long your lease lasts Jul 12, 2015 at 17:18

You must log in to answer this question.

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