Randomly no network connection after resume

Kernels & Hardware, configuring network, installing services

Randomly no network connection after resume

Postby piotrusch » 2018-11-04 12:29

Hi everybody,

for some time (a year or more) now I've been having the issue, that after suspend the PC randomly doesn't have ethernet connection. Randomly in this case means sometimes it happens after every suspend, sometimes after every second and sometimes it just runs flawlessly. The only thing which helps in such cases is a reboot or another suspend.

The system is an Intel NUC5i3ryh with a wired Intel Corporation Ethernet Connection (3) I218-V (rev 03) adapter. Network is configured by systemd-networkd with a static address and the used module is e1000e. It's connected to the router. The system is Debian 9 with some packages from 10. Here are the two different logs, first with not working connection:

Code: Select all
Nov 03 21:07:08 mypc kernel: e1000e: EEE TX LPI TIMER: 00000011
Nov 03 21:07:08 mypc kernel: e1000e 0000:00:19.0: System wakeup enabled by ACPI
Nov 03 21:07:08 mypc kernel: e1000e 0000:00:19.0: System wakeup disabled by ACPI
Nov 03 21:07:08 mypc kernel: e1000e: enp0s25 NIC Link is Up 10 Mbps Full Duplex, Flow Control: Rx/Tx
Nov 03 21:07:08 mypc kernel: e1000e 0000:00:19.0 enp0s25: 10/100 speed: disabling TSO


and second a working one:

Code: Select all
Nov 04 13:08:11 mypc kernel: e1000e: EEE TX LPI TIMER: 00000011
Nov 04 13:08:11 mypc kernel: e1000e 0000:00:19.0: System wakeup enabled by ACPI
Nov 04 13:08:11 mypc kernel: e1000e 0000:00:19.0: System wakeup disabled by ACPI
Nov 04 13:08:11 mypc kernel: e1000e: enp0s25 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx


It's been a long way so far with lots of trials but nothing has helped yet:

    Kept the BIOS updated
    Changed the router
    Changed the cable
    Tried different power saving options in the BIOS (PCI related etc.)
    Loaded the network card module (e1000e) with specific option (such as "options e1000e SmartPowerDownEnable=0")
    Changed the linux distro (ubuntu 16.04 to 18.04; recently to Debian)
    Reloaded network adapter and whole network stack on resume

I also tried to shut down the network before suspend and fired it up on resume which, as far as I remember, helped but isn't applicable since WOL doesn't work in this scenario which is needed here.

Unfortunately I ran out of ideas of what to try and where to investigate. Hopefully one of you can point me to the right spot to head on.

Regards, Piotrusch
piotrusch
 
Posts: 4
Joined: 2018-11-04 11:57

Re: Randomly no network connection after resume

Postby Head_on_a_Stick » 2018-11-04 13:10

piotrusch wrote:Network is configured by systemd-networkd with a static address and the used module is e1000e.

Can we please see the .network file, thanks!

piotrusch wrote:The system is Debian 9 with some packages from 10.

^ This means that you have broken your Debian box :(

See https://wiki.debian.org/DontBreakDebian

Probably best to re-install from scratch and try again.

Also, there is no Debian 10 (yet).

piotrusch wrote:Here are the two different logs

Does `journalctl -u systemd-networkd` have anything more to say?

piotrusch wrote:Reloaded network adapter and whole network stack on resume

^ How exactly did you do this?

In respect of WOL, have you tried https://wiki.archlinux.org/index.php/Wake-on-LAN#systemd.link?

FWIW, I use systemd-networkd in Debian buster and the connections resume just fine for me (both wireless & wired).
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8322
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Randomly no network connection after resume

Postby piotrusch » 2018-11-18 20:58

First of all I'd like to mention three new observations which might indicate (or not) a hardware issue:

- if after the resume I unplug the network cable from the pc and plug it in again, connectivity returns.
- powering off the pci device ("echo 1 > /sys/devices/pci0000\:00/0000\:00\:19.0/remove") and rescaning it doesn't change the situation, although the leds turned off after the remove and turned on again after the rescan
- connectivity sometimes reappears after the pc woke up from the next standby

Head_on_a_Stick wrote:
piotrusch wrote:Network is configured by systemd-networkd with a static address and the used module is e1000e.

Can we please see the .network file, thanks!


My bad. I used systemd-networkd when the pc ran Ubuntu. After installing Debian I stayed with the installer's choice but forgot it. This is how my /etc/network/interfaces looks like:

Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp0s25
iface enp0s25 inet static
   address 192.1.1.100/24
   gateway 192.1.1.1
   # dns-* options are implemented by the resolvconf package, if installed
   dns-nameservers 192.1.1.1
   dns-search router.local
   ethernet-wol g


piotrusch wrote:Reloaded network adapter and whole network stack on resume

How exactly did you do this?


When systemd took care about the networking I added the following commands to a script in /lib/systemd/system-sleep/ (I'm writing this from my memory as I don't use this any-more due to the missing impact on the issue. So please have mercy if there's a typo. They were correctly executed):

Code: Select all
systemctl systemd-networkd stop
systemctl systemd-resolved stop


And the other way around for the wakeup.

Although I studied the log quite in detail I didn't find anything suspicious except for the differing lines I added to the original posting.
piotrusch
 
Posts: 4
Joined: 2018-11-04 11:57

Re: Randomly no network connection after resume

Postby Head_on_a_Stick » 2018-11-19 06:07

piotrusch wrote:
Code: Select all
# The primary network interface
allow-hotplug enp0s25
iface enp0s25 inet static
   address 192.1.1.100/24
   gateway 192.1.1.1
   # dns-* options are implemented by the resolvconf package, if installed
   dns-nameservers 192.1.1.1
   dns-search router.local
   ethernet-wol g

Try adding
Code: Select all
auto enp0s25

just above the allow-hotplug line.

Otherwise check the journal for clues:
Code: Select all
journalctl -u networking

^ Run that as root unless your user is a member of the systemd-journal group.

piotrusch wrote:
Code: Select all
systemctl systemd-networkd stop
systemctl systemd-resolved stop

To restart ifupdown you should run
Code: Select all
systemctl restart networking
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8322
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Randomly no network connection after resume

Postby piotrusch » 2018-11-23 19:03

Head_on_a_Stick wrote:Try adding
Code: Select all
auto enp0s25

just above the allow-hotplug line.

Done. Unfortunately no impact.
Head_on_a_Stick wrote:Otherwise check the journal for clues:
Code: Select all
journalctl -u networking

Nothing obvious. Just this:
Code: Select all
Nov 23 09:42:22 mypc systemd[1]: Starting Raise network interfaces...
Nov 23 09:42:22 mypc systemd[1]: Started Raise network interfaces.

Head_on_a_Stick wrote:To restart ifupdown you should run
Code: Select all
systemctl restart networking

Tried that. No success, just the log lines above. Unplugging and replugging the cable seems the only thing that helps. Doesn't that sort of confirm a hardware issue when even the power off of the pci device doesn't change anything?
piotrusch
 
Posts: 4
Joined: 2018-11-04 11:57

Re: Randomly no network connection after resume

Postby Head_on_a_Stick » 2018-11-23 21:03

piotrusch wrote:Unplugging and replugging the cable seems the only thing that helps. Doesn't that sort of confirm a hardware issue when even the power off of the pci device doesn't change anything?

How about running the commands manually?
Code: Select all
# ifdown enp0s25
# ifup enp0s25

Does that bring the connection up again?

I would try disabling networking.service and setting up systemd-networkd instead (with WOL enabled) and see if that works.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8322
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Randomly no network connection after resume

Postby piper » 2018-11-24 12:10

Does as root

Code: Select all
dhclient -r; dhclient


Give you internet
User avatar
piper
 
Posts: 86
Joined: 2005-07-03 08:29

Re: Randomly no network connection after resume

Postby piotrusch » 2018-12-09 17:13

piper wrote:Does as root
Code: Select all
dhclient -r; dhclient

Give you internet

Nope. The log is:
Code: Select all
Nov 30 15:21:00 mypc dhclient[6872]: DHCPDISCOVER on enp0s25 to 255.255.255.255 port 67 interval 7
Nov 30 15:21:07 mypc dhclient[6872]: DHCPDISCOVER on enp0s25 to 255.255.255.255 port 67 interval 7
Nov 30 15:21:14 mypc dhclient[6872]: DHCPDISCOVER on enp0s25 to 255.255.255.255 port 67 interval 1
Nov 30 15:21:15 mypc dhclient[6872]: No DHCPOFFERS received.
Nov 30 15:21:15 mypc dhclient[6872]: No working leases in persistent database - sleeping.

And to be honest I don't entirely understand the idea behind as this is a static connection and pinging an IP doesn't work either.
Head_on_a_Stick wrote:How about running the commands manually?
Code: Select all
# ifdown enp0s25
# ifup enp0s25

Does that bring the connection up again?

No change. Just that:
Code: Select all
Nov 30 15:22:05 mypc kernel: e1000e: enp0s25 NIC Link is Down
Nov 30 15:22:16 mypc kernel: e1000e: enp0s25 NIC Link is Up 10 Mbps Full Duplex, Flow Control: Rx/Tx
Nov 30 15:22:16 mypc kernel: e1000e 0000:00:19.0 enp0s25: 10/100 speed: disabling TSO

I would try disabling networking.service and setting up systemd-networkd instead (with WOL enabled) and see if that works.

Had this before on ubuntu before I switched to Debian. No effects either.
piotrusch
 
Posts: 4
Joined: 2018-11-04 11:57


Return to System configuration

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable