Ethernet is suddenly down after reboot

I've recently installed Manjaro on my laptop. I have on a dual-boot setup with Windows 10 as my second system.

When the system was first installed the wi-fi wasn't working but I've managed to fix it by installing this driver.

Everything worked fine until I rebooted into Windows and then back into Manjaro.

Now the ethernet isn't working, I've tried probably all the solutions I could find:

  1. Reinstalling the driver
  2. Compiling and installing the driver manually from this repo
  3. I fiddled with wake-on-lan in Windows settings.
  4. I un-blacklisted r8169 and replaced r8168 with it - what happens then is that the interface is seemingly up but can't establish a connection.

A possible lead on how to solve this is that after executing:

> sudo modprobe -r r8168
> sudo modprobe r8168

The ethernet interface is seemingly up for a few seconds but the goes back to being down.

Some information:
> inxi -IN

Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8168 
           Device-2: Realtek RTL8821CE 802.11ac PCIe Wireless Network Adapter driver: rtl8821ce 
Info:      Processes: 194 Uptime: 17m Memory: 7.69 GiB used: 1.41 GiB (18.3%) Shell: bash inxi: 3.0.27 

> ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: wlp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether 60:14:b3:5d:18:3f brd ff:ff:ff:ff:ff:ff
10: enp4s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 54:e1:ad:90:4f:90 brd ff:ff:ff:ff:ff:ff

> nmcli device show enp4s0

GENERAL.DEVICE:                         enp4s0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         54:E1:AD:90:4F:90
GENERAL.MTU:                            1500
GENERAL.STATE:                          20 (unavailable)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
WIRED-PROPERTIES.CARRIER:               off

Windows is likely disabling the adapter with it's desire to rule the world. Unplug all power sources including battery and completely power down. Leave for a minute with no power then restart. That may restore the adapter to normal.

If that does not help, we will need more information to assist you in resolving your issue.

Please post:

hwinfo --netcard --wlan --bluetooth | grep -Ei "model\:|driver\:|status\:|cmd\:|file\:|detected\:" | grep -v "Config Status" 
inxi -Fxxzv8 
rfkill list all
lsmod

You could try:

sudo nmcli networking off
sleep 2
sudo systemctl stop NetworkManager
sleep 2
sudo ip link set enp4s0 down
sleep 2
sudo modprobe -r r8169
sudo modprobe -r r8168
sleep 2
sudo modprobe r8168
sleep 2
sudo ip link set enp4s0 up
sudo rfkill unblock all
sleep 2
sudo systemctl start NetworkManager
sleep 2
sudo nmcli networking on

I tried both and the problem still persists.

Here's all the information you requested

Could you also post the input/output of the script when it is run.

The script didn't output anything. It started and then after a few seconds it was over.

Run the script as root.

Enter "su" in the terminal, then input the root password.

Then paste the script into the terminal. Post all input and outputs. It is next to impossible that it does not output something if done correctly.

But it really didn't :confused:

[dzejkop-pc dzejkop]# sudo nmcli networking off
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo systemctl stop NetworkManager
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo ip link set enp4s0 down
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo modprobe -r r8169
[dzejkop-pc dzejkop]# sudo modprobe -r r8168
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo modprobe r8168
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo ip link set enp4s0 up
[dzejkop-pc dzejkop]# sudo rfkill unblock all
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo systemctl start NetworkManager
[dzejkop-pc dzejkop]# sleep 2
[dzejkop-pc dzejkop]# sudo nmcli networking on
[dzejkop-pc dzejkop]# 

Oddly enough it messed up my WiFi and I had to reboot for it to work again.

That script can not run without outputting an error unless you have both the r8168 and r8169 modules loaded. There is something wrong with your setup. You should not have installed a driver from outside sources unless absolutely necessary. The repositories have the proper r8168 driver and it should be installed through Manjaro settings manager.

su to root , then try this:

sudo systemctl stop NetworkManager
sleep 2
sudo ip link set enp4s0 down
sleep 2
sudo modprobe -r r8169
sudo modprobe -r r8168
sleep 2
sudo modprobe r8169
sleep 2
sudo ip link set enp4s0 up
sudo rfkill unblock all
sleep 2
sudo systemctl start NetworkManager
exit

Please post input/output.

If that is still bringing down your wifi then run this as root:

sudo ip link set enp4s0 down
sleep 2
sudo modprobe -r r8169
sudo modprobe -r r8168
sleep 2
sudo modprobe r8169
sleep 2
sudo ip link set enp4s0 up
exit

It did bring my wifi down. And there was no output but here's the interesting part:

After running that script and rebooting the ethernet works.

I'll try running it again tomorrow to see if I can get some meaningful output.

Create a script for restarting your Ethernet.

#!/bin/bash
sudo ip link set enp4s0 down
sleep 2
sudo modprobe -r r8169
sudo modprobe -r r8168
sleep 2
sudo modprobe r8169
sleep 2
sudo ip link set enp4s0 up
sleep 1
exit

Save the script as:

~/.config/bin/eth_restart.sh

Make the script executable:

chmod +x ~/.config/bin/eth_restart.sh

Once you have the script written, you can set it to execute automatically when you login as a startup script. Set it as a startup script in the KDE System Settings -> startup and shutdown -> autostart -> add script.

You should really blacklist the r8168 driver you installed from github. Stick to drivers from the repositories or the AUR. Only use outside drivers unless absolutely necessary.

What may have happened is you performed a system update. The kernel may have been updated. After you reboot the driver will often break after a kernel update (unless you have compiled a dkms driver version from github). Avoid installing drivers from external sources as they will often require recompiling after kernel updates.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by