Ethernet connection disappears

Questions about cabled networking
Forum rules
Before you post please read how to get help
Post Reply
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Ethernet connection disappears

Post by Moonraker »

I recently installed Mint 19.3 on an older Toshiba Satellite laptop and by and large everything seems to work pretty well, with one minor bugaboo.

In short, the Ethernet connection disappears after the laptop goes into suspend mode, or at other seemingly random times.

I've tried a slew of things to get the wired connection to wake up and reconnect, but no success so far. Here's some of what I've tried,based on various posts here and on other sites:

sudo service network-manager restart
sudo service networking restart
sudo service networking restart
sudo nmcli networking on
sudo systemctl restart NetworkManager.service

Restarting/rebooting seems to bring it back. Is there another way to turn it back on? My system info is below.



System: Host: TOSHIBASATA65 Kernel: 5.3.0-40-generic x86_64 bits: 64 compiler: gcc v: 7.4.0
Desktop: Cinnamon 4.4.8 wm: muffin dm: LightDM Distro: Linux Mint 19.3 Tricia
base: Ubuntu 18.04 bionic
Machine: Type: Laptop System: TOSHIBA product: Satellite A665 v: PSAW6U-03E007 serial: <filter>
Chassis: type: 10 serial: <filter>
Mobo: TOSHIBA model: PHQAA v: 1.00 serial: <filter> BIOS: TOSHIBA v: 1.80
date: 03/28/2011
Battery: ID-1: BAT1 charge: 1.4 Wh condition: 4.4/4.4 Wh (100%) volts: 10.7/11.1
model: COMPAL PABAS0241231 serial: <filter> status: Discharging
CPU: Topology: Dual Core model: Intel Core i5-2410M bits: 64 type: MT MCP arch: Sandy Bridge
rev: 7 L2 cache: 3072 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 18358
Speed: 1295 MHz min/max: 800/2900 MHz Core speeds (MHz): 1: 900 2: 933 3: 837 4: 864
Graphics: Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics
vendor: Toshiba America Info Systems driver: i915 v: kernel bus ID: 00:02.0
chip ID: 8086:0116
Display: x11 server: X.Org 1.20.5 driver: modesetting unloaded: fbdev,vesa
resolution: 1366x768~60Hz
OpenGL: renderer: Mesa DRI Intel Sandybridge Mobile v: 3.3 Mesa 19.2.8 compat-v: 3.0
direct render: Yes
Audio: Device-1: Intel 6 Series/C200 Series Family High Definition Audio
vendor: Toshiba America Info Systems driver: snd_hda_intel v: kernel bus ID: 00:1b.0
chip ID: 8086:1c20
Sound Server: ALSA v: k5.3.0-40-generic
Network: Device-1: Realtek RTL810xE PCI Express Fast Ethernet
vendor: Toshiba America Info Systems driver: r8169 v: kernel port: e000 bus ID: 01:00.0
chip ID: 10ec:8136
IF: enp1s0 state: up speed: 100 Mbps duplex: full mac: <filter>
Device-2: Intel Centrino Wireless-N 1000 [Condor Peak] driver: iwlwifi v: kernel
port: e000 bus ID: 02:00.0 chip ID: 8086:0083
IF: wlp2s0 state: down mac: <filter>
Drives: Local Storage: total: 596.17 GiB used: 19.97 GiB (3.4%)
ID-1: /dev/sda vendor: Toshiba model: MK6465GSXN size: 596.17 GiB speed: 3.0 Gb/s
serial: <filter>
Partition: ID-1: / size: 584.84 GiB used: 19.97 GiB (3.4%) fs: ext4 dev: /dev/dm-0
ID-2: swap-1 size: 976.0 MiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-1
Sensors: System Temperatures: cpu: 47.0 C mobo: N/A
Fan Speeds (RPM): N/A
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http: //mintmirror.math.washington.edu/linuxmint-repo tricia main upstream import backport
2: deb http: //la-mirrors.evowise.com/ubuntu bionic main restricted universe multiverse
3: deb http: //la-mirrors.evowise.com/ubuntu bionic-updates main restricted universe multiverse
4: deb http: //la-mirrors.evowise.com/ubuntu bionic-backports main restricted universe multiverse
5: deb http: //security.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
6: deb http: //archive.canonical.com/ubuntu/ bionic partner
Active apt repos in: /etc/apt/sources.list.d/skype-stable.list
1: deb [arch=amd64] https: //repo.skype.com/deb stable main
Active apt repos in: /etc/apt/sources.list.d/softmaker.list
1: deb http: //shop.softmaker.com/repo/apt wheezy non-free
Active apt repos in: /etc/apt/sources.list.d/teamviewer.list
1: deb http: //linux.teamviewer.com/deb stable main
Info: Processes: 217 Uptime: 2m Memory: 5.72 GiB used: 1.05 GiB (18.4%) Init: systemd v: 237
runlevel: 5 Compilers: gcc: 7.4.0 alt: 7 Client: Unknown python3.6 client inxi: 3.0.32
The future isn't what it used to be.
sleeper12
Level 12
Level 12
Posts: 4176
Joined: Thu May 25, 2017 3:22 pm

Re: Ethernet connection disappears

Post by sleeper12 »

Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

I tried this, as suggested in the referenced post:

Code: Select all

sudo apt-get install r8168-dkms
but unfortunately, it didn't resolve the issue.

When I boot, it'll connect to the wired connection and when it's connected, I can toggle the wired connection on and off with the switch in network applet in the task bar. But when it doesn't connect, the applet doesn't even display the wired connection toggle switch (even though it did before). (??)

Restarting the laptop restores the connection...until it goes into suspend, and then it's impossible to turn on no matter what I do, and the wired connection switch doesn't appear in the applet control in the task bar.
The future isn't what it used to be.
User avatar
kelebek333
Level 4
Level 4
Posts: 270
Joined: Sat Jun 25, 2011 11:57 am
Location: Türkiye
Contact:

Re: Ethernet connection disappears

Post by kelebek333 »

You can try this suggestion. Before remove r8168-dkms package.

Code: Select all

sudo apt purge r8168-dkms
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

Thanks, kelebek333.

Let me make sure I understand what I should do....

First, I should do: sudo apt purge r8168-dkms

Then (as root?) I should create a file in /etc/systemd/ named "system/fix-r8169.service", and in that file I should put this text:

Code: Select all

[Unit]
Description=Fix RTL-8169 Driver on resume from suspend
After=suspend.target

[Service]
User=root
Type=oneshot
ExecStartPre=/sbin/modprobe -r r8169
ExecStart=/sbin/modprobe r8169
TimeoutSec=0
StandardOutput=syslog

[Install]
WantedBy=suspend.target
And finally, after that's been done, at the command line I run "systemctl enable fix-r8169.service"

Have I understood this correctly?

Also, for what it's worth, here's a shot of my ethernet settings. Should it have a device specified?
ethernet-gen-settings.png
The future isn't what it used to be.
User avatar
kelebek333
Level 4
Level 4
Posts: 270
Joined: Sat Jun 25, 2011 11:57 am
Location: Türkiye
Contact:

Re: Ethernet connection disappears

Post by kelebek333 »

Have I understood this correctly?
Yes, it will be this way. this prepared service will be run after suspend/sleep. It briefly serves to deactivate and re-enable the r8169 driver.
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

I followed the steps above, but unfortunately it didn't seem to solve the problem.

With wifi turned off, I booted the laptop (ethernet was there), let it go into suspend and then woke it up after ~10 minutes. The ethernet connection didn't get restored.

Also, when it loses the connection after suspending and reawakening I don't see a switch for the ethernet in the network connections applet, just a switch for the wifi. If I reboot the laptop with the ethernet cable plugged in it sees the ethernet connection and it becomes available. The connections applet shows a switch to toggle the wired connection on and off (and a switch for the wifi as well.

When it loses the connection, it also doesn't seem to sense when the ethernet cable is removed and put back in- it doesn't 'see' the cable being attached and start the connection. (When the ethernet is working, like after rebooting, I can remove and replace the cable and it restores the ethernet connection.)

Not sure where to go from here, suggestions would be very welcome.
The future isn't what it used to be.
User avatar
kelebek333
Level 4
Level 4
Posts: 270
Joined: Sat Jun 25, 2011 11:57 am
Location: Türkiye
Contact:

Re: Ethernet connection disappears

Post by kelebek333 »

In this case, you can undo the changes with the following commands.

Code: Select all

sudo sytemctl stop system/fix-r8169.service
sudo sytemctl disable system/fix-r8169.service
sudo rm -f /etc/systemd/fix-r8169.service
sudo rm -f /etc/systemd/system/fix-r8169.service
Can you re-connect after suspend with following command?

Code: Select all

sudo systemctl restart network-manager
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

Here's what I ran (after fixing a typo) and here's what I got: (the user is 'bravo'). Some of the commands didn't seem to like using sudo. (??)

Code: Select all

bravo@TOSHIBA:~$ sudo sytemctl stop system/fix-r8169.service <--typo in 'systemmctl'
[sudo] password for bravo:      
sudo: sytemctl: command not found  (fixed the typo and retried)

bravo@TOSHIBA:~$ sudo systemctl stop system/fix-r8169.service
Failed to stop system-fix-r8169.service: Unit system-fix-r8169.service not loaded.

bravo@TOSHIBA:~$ systemctl stop system/fix-r8169.service
Failed to stop system-fix-r8169.service: Unit system-fix-r8169.service not loaded.

bravo@TOSHIBA:~$ sudo systemctl disable system/fix-r8169.service
Failed to lookup unit file state: Invalid argument

bravo@TOSHIBA:~$ sudo systemctl enable fix-r8169.service 
(I got nothing returned from this command)

bravo@TOSHIBA:~$ sudo systemctl stop system/fix-r8169.service
Failed to stop system-fix-r8169.service: Unit system-fix-r8169.service not loaded.

bravo@TOSHIBA:~$ systemctl stop system/fix-r8169.service
Failed to stop system-fix-r8169.service: Unit system-fix-r8169.service not loaded.

bravo@TOSHIBA:~$ systemctl stop system/fix-r8169.service
Failed to stop system-fix-r8169.service: Unit system-fix-r8169.service not loaded.
Heh, not sure what it's doing or why. It looks like the service wasn't loaded, but loading it seemed to have no effect.
I did not run the rm commands to remove anything, and that's where I stopped. Were some of these supposed to be 'systemd'??

For reference, here's a listing of the /etc/systemd/system" directory, the "fix-r8169.service" file is in there.

Code: Select all

/etc/systemd/system$ l
total 80K
drwxr-xr-x 17 root root 4.0K Mar  7 06:55 .
drwxr-xr-x  6 root root 4.0K Mar  5 16:18 ..
drwxr-xr-x  2 root root 4.0K Dec 13 08:37 bluetooth.target.wants
lrwxrwxrwx  1 root root   42 Mar  5 14:38 dbus-fi.w1.wpa_supplicant1.service -> /lib/systemd/system/wpa_supplicant.service
lrwxrwxrwx  1 root root   37 Mar  5 14:38 dbus-org.bluez.service -> /lib/systemd/system/bluetooth.service
lrwxrwxrwx  1 root root   40 Mar  5 14:38 dbus-org.freedesktop.Avahi.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx  1 root root   40 Mar  5 14:38 dbus-org.freedesktop.ModemManager1.service -> /lib/systemd/system/ModemManager.service
lrwxrwxrwx  1 root root   53 Mar  5 14:38 dbus-org.freedesktop.nm-dispatcher.service -> /lib/systemd/system/NetworkManager-dispatcher.service
lrwxrwxrwx  1 root root   44 Mar  5 14:38 dbus-org.freedesktop.resolve1.service -> /lib/systemd/system/systemd-resolved.service
lrwxrwxrwx  1 root root   36 Mar  5 14:38 dbus-org.freedesktop.thermald.service -> /lib/systemd/system/thermald.service
drwxr-xr-x  2 root root 4.0K Dec 13 08:38 default.target.wants
lrwxrwxrwx  1 root root   35 Mar  5 14:38 display-manager.service -> /lib/systemd/system/lightdm.service
drwxr-xr-x  2 root root 4.0K Dec 13 08:40 display-manager.service.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:38 final.target.wants
-rw-r--r--  1 root root  255 Mar  7 06:49 fix-r8169.service
drwxr-xr-x  2 root root 4.0K Dec 13 08:13 getty.target.wants
drwxr-xr-x  2 root root 4.0K Mar  5 15:03 graphical.target.wants
-rw-r--r--  1 root root  649 Dec  9 02:55 hddtemp.service
drwxr-xr-x  2 root root 4.0K Mar  5 20:21 multi-user.target.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:40 network-online.target.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:40 oem-config.service.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:36 paths.target.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:38 printer.target.wants
drwxr-xr-x  2 root root 4.0K Dec 13 08:42 sockets.target.wants
drwxr-xr-x  2 root root 4.0K Mar  7 06:55 suspend.target.wants
drwxr-xr-x  2 root root 4.0K Mar  5 16:20 sysinit.target.wants
lrwxrwxrwx  1 root root   35 Mar  5 14:38 syslog.service -> /lib/systemd/system/rsyslog.service
-rw-r--r--  1 root root  381 Mar  5 20:21 teamviewerd.service
drwxr-xr-x  2 root root 4.0K Dec 13 08:37 timers.target.wants
The future isn't what it used to be.
User avatar
kelebek333
Level 4
Level 4
Posts: 270
Joined: Sat Jun 25, 2011 11:57 am
Location: Türkiye
Contact:

Re: Ethernet connection disappears

Post by kelebek333 »

You can try following command.

Code: Select all

sudo systemctl stop fix-r8169.service
sudo systemctl disable fix-r8169.service
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

Ran those two commands. The first one produced no output, the second one produced this:

Removed /etc/systemd/system/suspend.target.wants/fix-r8169.service.

I then ran "sudo systemctl restart network-manager".

It produced no output and the ethernet didn't reconnect.



kelebek333 wrote:
Mon Mar 09, 2020 7:38 am
You can try following command.

Code: Select all

sudo systemctl stop fix-r8169.service
sudo systemctl disable fix-r8169.service
The future isn't what it used to be.
Moonraker
Level 3
Level 3
Posts: 117
Joined: Fri Dec 28, 2018 11:18 pm

Re: Ethernet connection disappears

Post by Moonraker »

One thing worth noting (I think) is that when the ethernet connection doesn't connect, the wired connection switch doesn't appear in the Network applet in the task bar.

I don't know if that means it doesn't see the hardware or something else, but when it is there I can toggle the ethernet on and off without any problem.
The future isn't what it used to be.
Post Reply

Return to “Ethernet”