Score:1

How do I restart ethernet after waking computer?

cn flag

How do I restart ethernet after waking my Ubuntu 20.04 computer from sleep mode?

If I reboot, ethernet works fine, but I want to get ethernet working without rebooting.

"sudo service network-manager restart" doesn't restart ethernet. I get something saying there's a configuration error.

Thanks.

From sudo lshw -C network:

  *-network DISABLED        
       description: Ethernet interface
       product: QCA8171 Gigabit Ethernet
       vendor: Qualcomm Atheros

From sudo lspci:

08:00.0 Ethernet controller: Qualcomm Atheros QCA8171 Gigabit Ethernet (rev 10)

From sudo /etc/init.d/network-manager status:

Aug 13 20:34:28 IdeaPad NetworkManager[640]: <info>  [1628908468.8532] device (enp8s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'managed')
in flag
Are there any messages in `/var/log/syslog` that point to an issue with the ethernet device? Could you also [edit] your question to include the output of `sudo lshw -C network` and `sudo lspci`? This will contain specific information about the network device, making it easier to offer a specific solution
heynnema avatar
ru flag
Go to the WiFi settings panel, observe if it's enabled at the top of the window. Locate, if you have one, a network enable/disable physical switch on the front/side of your computer, and may sure it's in the enabled position. Locate, if you have one, the Function key used to enable/disable the network. Confirm it's enabled. Use `rfkill list` and confirm nothing is disabled.
Kevin Berry avatar
cn flag
Hi heynnemma, Thank you. Wifi works fine after waking the computer from sleep, but it's the wired lan that only works after rebooting and is not working after waking from sleep. I want the wired lan to work after waking from sleep. It used to work fine after waking from sleep until the last update & upgrade.
CrazyTux avatar
us flag
Have you tried `ifup eth0`? Change eth0 with your ethernet interface, you can find the interface name by executing the command `ifconfig`
Kevin Berry avatar
cn flag
Yes, I installed ifupdown, added a reference for "iface enp8s0 auto dhcp" into the interfaces file, and tried sudo ifup enp8s0, but eth0 never activated. The ethernet icon appeared with some kind of disabled appearance, but there was no ethernet connectivity. I don't understand why the ethernet driver works on boot, but won't wake.
Score:1
nl flag

First determine the module that controls your ethernet.
lspci -vvnn | grep -A 9 -i ethernet
An example might be...
Kernel driver in use: tg3
Kernel modules: tg3
Then use modprobe to turn tg3 or whatever yours is off and on again.
sudo modprobe -r tg3
sudo modprobe tg3

Kevin Berry avatar
cn flag
This worked perfectly. In my case: sudo modprobe -r alx, then sudo modprobe alx. I am just in awe of people who can get right to the issue like you did. Thank you very very very much!!! (And thanks to everyone else offering assistance too!)
Score:0
gb flag

With network manager installed, you should use nmcli command line utility to maintain your network:

Show connections:

nmcli c show

Show devices:

nmcli d show

Restart networking:

nmcli networking off
nmcli networking on
Kevin Berry avatar
cn flag
Thank you for the suggestion. This does turn networking on and off, but I think the problem for me was my kernel ethernet driver was not getting restarted even with the network restarting. The answer above restarted the driver, and then my ethernet worked instantly again. Thank you very much for helping. I really appreciate it.
Kevin Berry avatar
cn flag
And I did finally see the usefullness of nmcli due to your suggestion here. Thanks!!!
pt flag
This is what actually worked for me. Thank you so much
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.