Ethernet not working out of the box

Only WiFi was working after booting live cd and after installation. After few hours i found out problem was because r8169 was blacklisted in /usr/lib/modprobe.d/, after deleting r8168.conf it is working.

ComplicatedWildKitten-small

Confused? How did deleting a blacklisted kernel parameter enable your ethernet nic? Did you remove the blacklist and then it worked as opposed to deleting?

its because also r8168 kernel driver is installed.

2 Likes

What are the contents of /usr/lib/modprobe.d/?

The ethernet not working because of r8169 being blacklisted is becoming quite a common annoyance in the forum.

I myself had the problem as have quite a few others over the last months (just search the forum for “r8169” and you’ll see).

Maybe we should provide the really simple fix as a Wiki article?

1 Like

Why is r8169 blacklisted? Isn’t that better than r8168 for new kernels?

2 Likes

I meant ethernet started working properly after deleting /usr/lib/modprobe.d/r8168.conf which blacklists r8169.
My ethernet controller does not work with r8168.

I think it is happening for the following reason? I’m not positive on this so anyone can correct me if they like. I can take it! The r8169 supposedly is a kernel module that loads automatically? The r8168 is a package that was added because some users were having issues with the r8169. On my system it was using r8168 without any issues. Other users were having problems with suspend and hibernate where the Ethernet is not working when it resumes from suspend or hibernate. It seems they need the r8169 in that case as it seems to work. I can verify that this has also happened to me now since i loaded the system and using btrfs and snapshots with suspend and hibernation. So i had to remove th r8168 and it works fine. with r8169. Before i was using r8168 with no issues!

Edit: On some systems it blacklists the r8169 not sure why. On mine both modules show but only uses one. Now i uninstalled th r8168.

If i’m wrong…well i’ve been wrong before. :grimacing:

1 Like

r8168 package is blacklisting r8169 on installing it…

but how can we fix this? I do not find any list of devices needed the one or the other module, if there would be a database to use we could detect and configure automatic.

3 Likes

If that’s the case why does it show both modules on mine. If it is blacklisted does it still show when you list modules?

modules are only not loading if they are blacklisted (ups this is not BLM compatible anymore) but they still are installed

2 Likes

I might know someone… :thinking:

2 Likes

hm it is not useful for us using r8168 package what is blacklisting the same :wink: we will need opposite

1 Like

There are so many revisions of the r8168 adapter, and different bugs that affect only specific revisions. I forget exactly how many there are, but there’s lots of different ones (more than I’d care to tackle at this point in time). Perhaps in a few months when summer is over I’d feel like looking at the possibilities.



On the bright side you can easily use a service to correct suspend problems with either the r8168 or r8169 driver.



Suspend issues with the r8168 adapter can often be resolved by simply switching to the r8169 kernel module. It is often better to use the r8169 kernel module rather than the r8168 driver.

You can check which Realtek driver module is loaded with this command:

lsmod | grep r816

You can create a service to automatically disable your network components at suspend, and then re-enable them at resume (if you are having suspend problems). This usually allows you to suspend properly if your r8168 based Ethernet adapter is is causing the problem.


R8168/9 Network Suspend Service


Create the following service file with a text editor:

/etc/systemd/system/network-restart.service

Add the following contents to the file:

#cat /etc/systemd/system/network-restart.service
#systemctl enable network-restart.service
#systemctl start network-restart.service
#systemctl stop network-restart.service
#systemctl disable network-restart.service
#systemctl status network-restart.service

[Unit]
Description=Network Suspend/Resume Service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/ip link set enp2s0 down
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/modprobe -r r8169
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/modprobe r8169
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/ip link set enp2s0 up
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/systemctl start NetworkManager
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'

[Install]
WantedBy=sleep.target



The sleep units in the service may be reduced, (or eliminated) if you do not like the delay it creates. Be aware though, that doing so may reduce the reliability of the service. If you find the service is not working properly for you, then you should try increasing the sleep times. It has been reported that some kernels require adding more sleep time between executing commands to work reliably.

Once you have created and saved the service file, enable the service:

systemctl enable network-restart.service

Then reboot the computer.



Adapt this service to your installation (if different than above). If your adapter’s designation is different than “enp2s0”, you will need to substitute you own adapter’s ID into the service file.

If you are using the r8168 module you will need to substitute it in place of the r8169 module in the service.

R8169 is usually the recommended driver module for this adapter. You can substitute either module in the above service depending on which driver module you prefer.

You can find your adapter driver/module and network device identification to substitute into the service with the following command:

inxi -nz


6 Likes