3

I've installed Ubuntu 14.04 on my new notebook and I've got a problem with internet connectivity. When I boot the computer, everything works perfectly fine, but after rebooting using the button in the top right corner (eg after a kernel update), wired internet just doesn't work anymore. There's no problem with wireless, though (however, I mainly use LAN). It can't be a hardware problem, because it works on Windows (it is a dual-boot machine). Mysteriously enough, everything works perfectly if I just plug the notebook in before rebooting - even if I reboot on battery (-> broken) and then one more time on AC (-> fixed again).

I've been doing some further testing: nothing changes if I cut the connection (physically, in the network manager or both) prior to rebooting. sudo service networking restart also has no effect with the output

stop: Job failed while stopping 
start: Job is already running: networking

However, sudo service network-manager restart kills the connection in the same way as a reboot, forcing me to shut the computer down and then do a coldboot to get it operational again, but again only when the notebook is running on battery.

I've been thinking_

What could be the cause of that behaviour?

Further command outputs:

lspci -knn | grep Eth -A2:

05:00.1 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 12)
Subsystem: ASUSTeK Computer Inc. Device [1043:200f]
Kernel driver in use: r8169

on LAN (working or not) as well as on wireless (to be expected, I just wanted to make sure).

ifconfig:

eth0      Link encap:Ethernet  HWaddr 08:62:66:b5:0f:78  
      inet addr:192.168.1.112  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a62:66ff:feb5:f78/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:9907 errors:0 dropped:0 overruns:0 frame:0
      TX packets:6660 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:9730805 (9.7 MB)  TX bytes:726284 (726.2 KB)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:2391 errors:0 dropped:0 overruns:0 frame:0
      TX packets:2391 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:228361 (228.3 KB)  TX bytes:228361 (228.3 KB)
9
  • 1
    Please edit your question and add output of lspci -knn | grep Eth -A2 terminal command.
    – Pilot6
    Aug 11, 2015 at 14:04
  • What kind of notebook? Do you have an exact model type? Aug 11, 2015 at 14:46
  • @Pilot6: I've added the output along with some other information - especially worth noting: the problem only occurs when running on battery
    – haemi
    Aug 12, 2015 at 18:59
  • @meskobalazs: it is an Asus N551JX-CN156H
    – haemi
    Aug 12, 2015 at 19:01
  • 1
    @Fabby: I was able to solve the problem - it had nothing to do with ethernet-configuration per se but with power-saving settings (hinted at by the battery/ac-difference) and wake-on-lan; I'll submit a proper answer later on. Thanks anyway for your efforts :)
    – haemi
    Aug 13, 2015 at 19:24

1 Answer 1

2

I've solved the problem: because of the battery/ac-situation, I looked at the power-saving settings in powertop and noticed that plugging the notebook in toggled the wake-on-lan-setting.

Anyway, by trial-and-error I figured out that LAN works after both rebooting and sudo service network-manager restart if wake-on-lan is activated (I've no idea as to why since I was just lucky enough to stumble over it - I'd be happy if anyone could offer any insight). Therefore, my solution was to add

sleep 1
sudo ethtool -s eth0 wol g

to rc.local (the value for sleep might be machine-dependant - I've replaced the HDD that came with the computer with an SSD, so for other machines it might have to be higher; the trick is that the command must be executed after the network interfaces have been configured). This way, wol is always activated, regardless of the power state - but with one exception: if you boot the computer on ac and pull the plug some time later, it reverts to the off-state. Normally, this shouldn't be too much of an issue, as you'd have to restart the network-manager via the command line to notice it - and if that really is necessary, a reboot might also be a good idea. Nevertheless, this behaviour can also be fixed by adding a small script to /etc/pm/power.d/ (similar to the one in the first answer to this question): in the battery-mode-branch, you put

sudo ethtool -s eth0 wol g

and the ac-mode-branch stays empty.

You must log in to answer this question.

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