1

Two os installed on my pc,today a strange thing happens:my ethernet device lost in debian! Enter into win10 from grub, i can connect internet with pppoe.
Enter into debian10 from grub :

ifconfig

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1120 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1120 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



sudo lshw -C network
  *-network UNCLAIMED       
       description: Ethernet controller
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:06:00.0
       version: 15
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix bus_master cap_list
       configuration: latency=0
       resources: ioport:f000(size=256) memory:fcd04000-fcd04fff memory:fcd00000-fcd03fff

I get the mac address info--xx:xx:70:c2:2c:4a from ipconfig /all in win10.

sudo pppoeconf  xx:xx:70:c2:2c:4a
Cannot find device "xx:xx:70:c2:2c:4a"
ioctl(SIOCGIFHWADDR): No such device
Cannot find device "xx:xx:70:c2:2c:4a"
Plugin rp-pppoe.so loaded.
/usr/sbin/pppd: unknown host: nic-00

Download r8168-dkms_8.048.03-1~bpo10+1_all.deb with win10 into usb,and enter into debian10.

sudo mount /dev/sdc  /mnt
sudo dpkg -i  /mnt/r8168-dkms_8.048.03-1~bpo10+1_all.deb

After re-install it:

sudo pppoeconf  xx:xx:70:c2:2c:4a 
#input account name and password
sudo pon dsl-provier
plugin rp-pppoe.so load
/usr/sbin/pppd:unknown host nic-00

Just yesterday i can connect to internet with pppoe in debian10,how to fix then?

If Windows was hibernated it could have turn the card into the state when it is unusable in Debian. The solution could be to assure Windows was shut down, not hibernated.
@Nikita Kipriyanov ,i am sure that it is un-related with windows.
I installed a new debian10 with same version after the old debian10 can't recognize ethernet device ,now there are three oses in my pc instead of dual. enter image description here

Enter into the new installed debian , i can connect internet with pppoeconf!That is to say, both win10 and new installed debian10 can connect with internet!Why my old debian10 can't recognize ethernet device!
I downloaded firmware-realtek_20190114-2_all.deb into usb in win10 and dpkg it in the old debian10,nothing changed!
All drivers show:

modinfo r8169
filename:       /lib/modules/5.10.0-0.bpo.7-amd64/kernel/drivers/net/ethernet/realtek/r8169.ko
firmware:       rtl_nic/rtl8125b-2.fw
firmware:       rtl_nic/rtl8125a-3.fw
firmware:       rtl_nic/rtl8107e-2.fw
firmware:       rtl_nic/rtl8107e-1.fw
firmware:       rtl_nic/rtl8168fp-3.fw
firmware:       rtl_nic/rtl8168h-2.fw
firmware:       rtl_nic/rtl8168h-1.fw
firmware:       rtl_nic/rtl8168g-3.fw
firmware:       rtl_nic/rtl8168g-2.fw
firmware:       rtl_nic/rtl8106e-2.fw
firmware:       rtl_nic/rtl8106e-1.fw
firmware:       rtl_nic/rtl8411-2.fw
firmware:       rtl_nic/rtl8411-1.fw
firmware:       rtl_nic/rtl8402-1.fw
firmware:       rtl_nic/rtl8168f-2.fw
firmware:       rtl_nic/rtl8168f-1.fw
firmware:       rtl_nic/rtl8105e-1.fw
firmware:       rtl_nic/rtl8168e-3.fw
firmware:       rtl_nic/rtl8168e-2.fw
firmware:       rtl_nic/rtl8168e-1.fw
firmware:       rtl_nic/rtl8168d-2.fw
firmware:       rtl_nic/rtl8168d-1.fw
license:        GPL
softdep:        pre: realtek
description:    RealTek RTL-8169 Gigabit Ethernet driver

ls /lib/firmware/rtl_nic
rtl8105e-1.fw  rtl8107e-1.fw  rtl8125b-2.fw  rtl8168d-2.fw  rtl8168e-3.fw  rtl8168fp-3.fw  rtl8168g-3.fw  rtl8402-1.fw
rtl8106e-1.fw  rtl8107e-2.fw  rtl8153a-3.fw  rtl8168e-1.fw  rtl8168f-1.fw  rtl8168g-1.fw   rtl8168h-1.fw  rtl8411-1.fw
rtl8106e-2.fw  rtl8125a-3.fw  rtl8168d-1.fw  rtl8168e-2.fw  rtl8168f-2.fw  rtl8168g-2.fw   rtl8168h-2.fw  rtl8411-2.fw

No ethernet device such as enp*s*.

ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1120 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1120 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

uname -a
Linux debian 5.10.0-0.bpo.7-amd64 #1 SMP Debian 5.10.40-1~bpo10+1 (2021-06-04) x86_64 GNU/Linux
showkey
  • 79
  • 23
  • 67
  • 128
  • 1
    Missing drivers or firmware, probably because they are in the non-free section. – dirkt Jun 29 '21 at 04:06
  • Even if you have a r8168 you probably should stick to default r8169 driver ( https://unix.stackexchange.com/questions/26997/whats-the-difference-between-the-drivers-r8169-and-r8168 ). **AND** anyway install firmware-realtek – A.B Jun 29 '21 at 07:21
  • 1
    If Windows was hibernated it could have turn the card into the state when it is unusable in Debian. The solution could be to assure Windows was *shut down*, not hibernated. Also try to cut all power from the machine (leave only CMOS Li battery) to erase all temporary state. // All in all, I don't see a point in double booting. If you want Windows, use Windows. If you want Linux, use Linux. Just decide already and don't use both. – Nikita Kipriyanov Jun 29 '21 at 09:34
  • @Nikita Kipriyanov ,i am sure that it is un-related with windows. I installed a new debian10 with same version after the old debian10 can't recognize ethernet device ,now there are three oses in my pc instead of dual. Enter into the new installed debian , i can connect internet with pppoeconf!!!Both win10 and new installed debian10 can connect with internet!Why my old debian10 can't recognize ethernet device! – showkey Jun 29 '21 at 23:09

2 Answers2

1

The package r8168-dkms_8.048.03-1~bpo10+1_all.deb includes the file /etc/modprobe.d/r8168-dkms.conf, which will tell the kernel to load the r8168 module instead of the default r8169 for specific card models.

The package includes the r8168 module in source code form only: in order to make it usable, the dkms utility will be used by this package to automatically build the module for every kernel version you're using.

(here's the list of contents for that package)

But DKMS can only do its job if you have the compiler and the linux-headers package that matches your exact kernel version installed. Either you don't have the appropriate linux-headers package for your current kernel installed, or something has gone wrong when DKMS was trying to auto-build the r8168 module for you.

You should begin troubleshooting by verifying DKMS is in the proper state, by running sudo dkms status.

If the kernel module is properly built, the output of the dkms status command should include a line like this:

r8168, 8.048.03, <your current kernel version>, amd64: installed

The <your current kernel version> field should exactly match the output of uname -r.

The word installed at the end means the actual binary module has been successfully built and inserted into the current kernel's /lib/modules/$(uname -r)/... directory tree. Other possible status words are built which means the binary module has been successfully built but has not yet been made available to the kernel, and added which means the source code for the module has been installed but the binary module is not built yet.

You should verify that you have the appropriate linux-headers package installed, and then retry building the module by running:

sudo dkms install r8168/8.048.03

If it reports a problem, a more detailed log of the build process and any error messages encountered during it can be found at /var/lib/dkms/r8168/8.048.03/$(uname -r)/x86_64/log/make.log.

If you wish to try the default r8169 driver instead, you will need to uninstall the r8168-dkms_8.048.03-1~bpo10+1_all.deb package, or rename the /etc/modprobe.d/r8168-dkms.conf to e.g. /etc/modprobe.d/r8168-dkms.conf.disabled and run sudo update-initramfs -u to propagate the change into your current initramfs file too.

telcoM
  • 87,318
  • 3
  • 112
  • 232
0

Check the present status.

debian@debian:~$ sudo dkms status
r8168, 8.048.03: added
debian@debian:~$  sudo dkms install r8168/8.048.03
Error! Your kernel headers for kernel 5.10.0-0.bpo.7-amd64 cannot be found.
Please install the linux-headers-5.10.0-0.bpo.7-amd64 package,
or use the --kernelsourcedir option to tell DKMS where it's located

I downloaded the linux-headers-5.10.0-0.bpo.7-amd64_5.10.40-1~bpo10+1_amd64.deb into usb, and mount usb to install:

sudo dpkg -i  linux-headers-5.10.0-0.bpo.7-amd64_5.10.40-1~bpo10+1_amd64.deb
Selecting previously unselected package linux-headers-5.10.0-0.bpo.7-amd64.
(Reading database ... 269528 files and directories currently installed.)
Preparing to unpack .../linux-headers-5.10.0-0.bpo.7-amd64_5.10.40-1~bpo10+1_amd64.deb ...
Unpacking linux-headers-5.10.0-0.bpo.7-amd64 (5.10.40-1~bpo10+1) ...
dpkg: dependency problems prevent configuration of linux-headers-5.10.0-0.bpo.7-amd64:
 linux-headers-5.10.0-0.bpo.7-amd64 depends on linux-headers-5.10.0-0.bpo.7-common (= 5.10.40-1~bpo10+1); however:
  Package linux-headers-5.10.0-0.bpo.7-common is not installed.
 linux-headers-5.10.0-0.bpo.7-amd64 depends on linux-kbuild-5.10 (>= 5.10.40-1~bpo10+1); however:
  Version of linux-kbuild-5.10 on system is 5.10.24-1~bpo10+1.

dpkg: error processing package linux-headers-5.10.0-0.bpo.7-amd64 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-5.10.0-0.bpo.7-amd64

Now download the linux-headers-5.10.0-0.bpo.5-amd64_5.10.24-1~bpo10+1_amd64.deb and install it.

sudo dpkg -i  linux-headers-5.10.0-0.bpo.5-amd64_5.10.24-1~bpo10+1_amd64.deb
sudo mv  /etc/modprobe.d/r8168-dkms.conf   /etc/modprobe.d/r8168-dkms.conf.disabled
sudo update-initramfs -u

Reboot:

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
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 00:e0:70:c2:2c:4a brd ff:ff:ff:ff:ff:ff

I can connect internet!

showkey
  • 79
  • 23
  • 67
  • 128
  • Looks like you disabled the `r8168` module, and still got a functional network interface. Run `ethtool -i enp6s0` to verify: if it now shows `driver: r8169`, you will no longer need the `r8168-dkms` package and can just uninstall it. The `r8169` driver that is included in the standard kernel packages has now been updated to handle your specific card model. – telcoM Jul 03 '21 at 01:19