Ethernet not working after suspend

Asked by Linobaldius

Whenever I suspend on my Ubuntu 16.04, the Ethernet (which should be working fine) isn't connected (WIFI works) and says 'Cable unplugged'. There are a lot of people that have solved similar issues, but none of their solutions or workarounds seem to work for me.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

sudo lshw -C network; lsb_release -a; uname -a

Thanks

Revision history for this message
Linobaldius (leee49) said :
#2

sudo lshw -C network returns

  *-network
       description: Ethernet interface
       product: 88E8071 PCI-E Gigabit Ethernet Controller
       vendor: Marvell Technology Group Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: enp2s0
       version: 16
       serial: 00:1d:72:3e:27:5f
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=sky2 driverversion=1.30 duplex=full ip=192.168.1.67 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:24 memory:f6100000-f6103fff ioport:3000(size=256) memory:f6120000-f613ffff
  *-network
       description: Wireless interface
       product: WiFi Link 5100
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlp3s0
       version: 00
       serial: 00:16:ea:50:d4:56
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-24-generic firmware=8.83.5.1 build 33692 ip=192.168.1.63 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:27 memory:f6200000-f6201fff

lsb-release -a returns

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial

uname -a returns

Linux <name> 4.15.0-24-generic #26~16.04.1-Ubuntu SMP Fri Jun 15 14:35:08 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
(<name> is my computer's name)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

After waking up from suspend, if you run:

sudo modprobe -r sky2; sleep 3; sudo modprobe sky2

Does it start working OK?

Revision history for this message
Linobaldius (leee49) said :
#4

Actually, yes. But I don't want to do this everytime I suspend. Is there a way to do this automatically?

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#5

Their certainly is.

If you run:

sudo gedit /usr/bin/ethernetfix; sudo chmod +x /usr/bin/ethernetfix

Add the below 2 lines to the file:

#!/bin/bash
modprobe -r sky2; sleep 3; sudo modprobe sky2

Does

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

Ignore the the "does" word there, bad paste. OK we now have a script to fix the ethernet. Does this work OK if you run:

sudo ethernetfix

Does it make the ethernet work OK? If so, we can make it run when the system wakes up

Revision history for this message
Linobaldius (leee49) said :
#7

That does make the ethernet work. How do I make this run on waking up?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

A quick websearch shows how. You want to run the script at wake up
https://askubuntu.com/questions/226278/run-script-on-wakeup

Something like this.

Revision history for this message
Linobaldius (leee49) said :
#9

Thanks actionparsnip, that solved my question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#10

Dead simple. You can add other junk to that script too