Ubuntu 20.04 以太网 R8168

V C*_*ode 5 network-manager networking internet ethernet drivers

在此输入图像描述

在此输入图像描述 这是我的硬件信息:

lshw:

ubuntu@ubuntu:~$ sudo lshw -C network
  *-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:03:00.0
       logical name: enp3s0
       version: 09
       serial: 04:d9:f5:31:bf:d6
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.8.0-43-generic firmware=rtl8168f-1_0.0.5 06/18/12 latency=0 link=no multicast=yes port=MII
       resources: irq:17 ioport:e000(size=256) memory:f0004000-f0004fff memory:f0000000-f0003fff
  *-network
       description: Ethernet interface
       physical id: 2
       bus info: usb@2:1.6
       logical name: usb0
       serial: 4a:95:ce:43:80:51
       capabilities: ethernet physical
       configuration: broadcast=yes driver=rndis_host driverversion=22-Aug-2005 firmware=RNDIS device ip=192.168.42.193 link=yes multicast=yes
Run Code Online (Sandbox Code Playgroud)

RTL8111/8167/8411在我的系统上显示时出现问题

nmcli:

ubuntu@ubuntu:~$ sudo nmcli
usb0: connected to Wired connection 2
        "Qualcomm SDM636-QRD SN:3166A9F8"
        ethernet (rndis_host), 4A:95:CE:43:80:51, hw, mtu 1500
        ip4 default
        inet4 192.168.42.193/24
        route4 0.0.0.0/0
        route4 192.168.42.0/24
        route4 169.254.0.0/16
        inet6 fe80::a150:e699:1a23:b83f/64
        route6 fe80::/64
        route6 ff00::/8

enp3s0: unavailable
        "Realtek RTL8111/8168/8411"
        ethernet (r8169), 04:D9:F5:31:BF:D6, hw, mtu 1500

lo: unmanaged
        "lo"
        loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
        servers: 192.168.42.129
        interface: usb0

Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.

Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
Run Code Online (Sandbox Code Playgroud)

- - - 更新 - - - -

route -n:

ubuntu@Linux:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.42.129  0.0.0.0         UG    20100  0        0 usb0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 usb0
192.168.42.0    0.0.0.0         255.255.255.0   U     100    0        0 usb0
Run Code Online (Sandbox Code Playgroud)

ip a:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 04:d9:f5:31:bf:d6 brd ff:ff:ff:ff:ff:ff
4: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether e6:4a:fc:3a:7c:8b brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.109/24 brd 192.168.42.255 scope global dynamic noprefixroute usb0
       valid_lft 3104sec preferred_lft 3104sec
    inet6 fe80::6e7f:9504:2062:a207/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
Run Code Online (Sandbox Code Playgroud)

lsusb:

Bus 002 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Run Code Online (Sandbox Code Playgroud)

寻找/etc/network/interfaces但得到这个结果:

ubuntu@Linux:/etc/network$ ls -la
total 32
drwxr-xr-x   6 root root  4096 Feb 10 01:50 .
drwxr-xr-x 134 root root 12288 Mar 29 00:19 ..
drwxr-xr-x   2 root root  4096 Mar 28 22:24 if-down.d
drwxr-xr-x   2 root root  4096 Mar 28 22:24 if-post-down.d
drwxr-xr-x   2 root root  4096 Mar 28 22:36 if-pre-up.d
drwxr-xr-x   2 root root  4096 Mar 28 22:36 if-up.d
Run Code Online (Sandbox Code Playgroud)

/etc/netplan/01-network-manager-all.yaml:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

Run Code Online (Sandbox Code Playgroud)

Elo*_*ise 4

这可能是驱动程序的问题。您安装了r8168 RealTek驱动程序吗?

sudo apt-get update

sudo apt-get install r8168-dkms

** 编辑 **

请注意,此驱动程序只能用于内核驱动程序 r8169 尚不支持的设备。安装 r8168-dkms 软件包将禁用内核中的 r8169 模块。要重新启用 r8169,必须清除 r8168-dkms 软件包。

另外阅读此线程可能会有所帮助