Ethernet controllers not working (Realtek RTL810xE, Realtek RTL8111)

EDIT: I've found an appropriate driver

https://github.com/ghostrider-reborn/realtek-r8101-linux-driver

I followed instructions here and now both network cards work (I only use one at a time because I'm testing connecting them to the same network.)

Original post

I installed Kubuntu 18.04 on a computer which has previously been running Kubuntu 14.04, and I've not been able to get one of the two network cards working successfully. Unfortunately, I need both of them to be configured for my lab setup.

I've tried plugging either of them with the same ethernet cable, but only the RTL8111 ever works. dmesg doesn't have anything for Ethernet or Network in it, and journalctl -xe only mentions the successful loading of the RTL8111 driver.

Below are some diagnostic outputs that you will hopefully find useful

lshw -C network

  *-network UNCLAIMED
       description: Ethernet controller
       product: RTL810xE PCI Express Fast Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       version: 02
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list
       configuration: latency=0
       resources: ioport:b800(size=256) memory:f7cff000-f7cfffff memory:cfff0000-cfffffff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:01:00.0
       logical name: enp1s0
       version: 03
       serial: [redacted]
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.046.00-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:31 ioport:a800(size=256) memory:cfeff000-cfefffff memory:cfef8000-cfefbfff memory:f7be0000-f7bfffff
  *-network
       description: Ethernet interface
       physical id: 1
       logical name: enp0s26f7u1
       serial: [redacted]
       capabilities: ethernet physical
       configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device ip=192.168.42.163 link=yes multicast=yes

Kubuntu can see the network cards (the third device is my phone using USB tethering), however the first one is "UNCLAIMED"

lspci -v | grep -A20 Ethernet

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)
        Subsystem: ASRock Incorporation Motherboard (one of many)
        Physical Slot: 0-3
        Flags: bus master, fast devsel, latency 0, IRQ 31
        I/O ports at a800 [size=256]
        Memory at cfeff000 (64-bit, prefetchable) [size=4K]
        Memory at cfef8000 (64-bit, prefetchable) [size=16K]
        Expansion ROM at f7be0000 [disabled] [size=128K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [ac] MSI-X: Enable- Count=4 Masked-
        Capabilities: [cc] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number [redacted]
        Kernel driver in use: r8168
        Kernel modules: r8168

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 02)
        Subsystem: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller
        Physical Slot: 0-2
        Flags: bus master, fast devsel, latency 0, IRQ 11
        I/O ports at b800 [size=256]
        Memory at f7cff000 (64-bit, non-prefetchable) [size=4K]
        Memory at cfff0000 (64-bit, prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [ac] MSI-X: Enable- Count=2 Masked-
        Capabilities: [cc] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number [redacted]

It has loaded the kernel module for the first card, however it hasn't done anything for the second card.

lsmod

Module                  Size  Used by
intel_powerclamp       20480  0
snd_hda_codec_realtek   114688  1
coretemp               20480  0
snd_hda_codec_generic    77824  1 snd_hda_codec_realtek
kvm_intel             241664  0
ledtrig_audio          16384  2 snd_hda_codec_generic,snd_hda_codec_realtek
kvm                   647168  1 kvm_intel
snd_hda_intel          49152  5
irqbypass              16384  1 kvm
snd_hda_codec         135168  3 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec_realtek
snd_hda_core           86016  4 snd_hda_codec_generic,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek
rndis_host             20480  0
snd_hwdep              20480  1 snd_hda_codec
ni_pcimio              73728  0
cdc_ether              20480  1 rndis_host
ni_tiocmd              16384  1 ni_pcimio
mite                   20480  2 ni_tiocmd,ni_pcimio
snd_pcm               102400  4 snd_hda_intel,snd_hda_codec,snd_hda_core
usbnet                 45056  2 rndis_host,cdc_ether
comedi_pci             16384  2 mite,ni_pcimio
intel_cstate           20480  0
mii                    16384  1 usbnet
ni_routing            299008  2 ni_tiocmd,ni_pcimio
input_leds             16384  0
ni_tio                 20480  2 ni_tiocmd,ni_pcimio
comedi_8255            16384  1 ni_pcimio
snd_seq_midi           20480  0
snd_seq_midi_event     16384  1 snd_seq_midi
comedi                 73728  5 mite,comedi_pci,ni_tiocmd,ni_pcimio,comedi_8255
snd_rawmidi            36864  1 snd_seq_midi
snd_seq                69632  2 snd_seq_midi,snd_seq_midi_event
gpio_ich               16384  0
snd_seq_device         16384  3 snd_seq,snd_seq_midi,snd_rawmidi
snd_timer              36864  2 snd_seq,snd_pcm
snd                    86016  19 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_pcm,snd_rawmidi
serio_raw              20480  0
soundcore              16384  1 snd
i5500_temp             16384  0
lpc_ich                24576  0
i7core_edac            24576  0
mac_hid                16384  0
sch_fq_codel           20480  3
parport_pc             36864  0
ppdev                  24576  0
lp                     20480  0
parport                53248  3 parport_pc,lp,ppdev
ip_tables              32768  0
x_tables               40960  1 ip_tables
autofs4                45056  2
nouveau              1871872  20
hid_generic            16384  0
video                  49152  1 nouveau
i2c_algo_bit           16384  1 nouveau
ttm                   102400  1 nouveau
mxm_wmi                16384  1 nouveau
drm_kms_helper        180224  1 nouveau
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
psmouse               151552  0
sysimgblt              16384  1 drm_kms_helper
usbhid                 53248  0
fb_sys_fops            16384  1 drm_kms_helper
hid                   126976  2 usbhid,hid_generic
drm                   483328  10 drm_kms_helper,ttm,nouveau
firewire_ohci          40960  0
pata_acpi              16384  0
ahci                   40960  0
firewire_core          65536  1 firewire_ohci
r8168                 528384  0
pata_via               16384  0
libahci                32768  1 ahci
crc_itu_t              16384  1 firewire_core
wmi                    28672  2 mxm_wmi,nouveau

5th line from the end is the driver for the RTL8111 card, and I don't know if this is actually useful for you at all.

lspci -nn


01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 03)

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet Controller [10ec:8136] (rev 02)

lspci -nn

01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 03)

02:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet Controller [10ec:8136] (rev 02)

modinfo r8169 | grep 8136 # the r8169 driver will see the RTL810xE

alias:          pci:v000010ECd00008136sv*sd*bc*sc*i*

The system is not seeing the RTL810xE ethernet card. This is because you have the r8168-dkms driver installed, which works fine for the RTL8111/8168/8411 ethernet card, but not the RTL810xE.

Recommend uninstalling the r8101 github driver, and the r8168-dkms driver, and letting the standard r8169 driver find both cards.

This would also make software updates faster if kernel updates are included, as it won't have to additionally rebuild dkms drivers.