Realtek 8169 千兆以太网适配器在戴尔 Inspiron 5565 中仅 100Mbps,驱动程序安装无法解决

Realtek 8169 千兆以太网适配器在戴尔 Inspiron 5565 中仅 100Mbps,驱动程序安装无法解决

我刚买了一台戴尔 Inspiron 5565。它有一个 realtek r8169 千兆网卡,以 100 Mbps(而不是 1000 Mbps)的速度与我安装的 Ubuntu 18.04 LTS 连接。我尝试从 realtek 下载驱动程序,并按照说明进行操作。这是驱动程序的链接,自述文件有说明 :)。Realtek r8169 驱动程序

我使用 sudo apt-get install make 安装了 make 当我尝试使用 sudo make clean modules 时出现错误:

make -C src/ clean
make[1]: Entering directory '/home/username/Documents/r8169-6.025.03/src'
make -C /lib/modules/4.15.0-22-generic/build SUBDIRS=/home/username/Documents/r8169-6.025.03/src clean
make[2]: Entering directory '/usr/src/linux-headers-4.15.0-22-generic'
  CLEAN   /home/username/Documents/r8169-6.025.03/src/.tmp_versions
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-22-generic'
make[1]: Leaving directory '/home/username/Documents/r8169-6.025.03/src'
make -C src/ modules
make[1]: Entering directory '/home/username/Documents/r8169-6.025.03/src'
make -C /lib/modules/4.15.0-22-generic/build SUBDIRS=/home/username/Documents/r8169-6.025.03/src modules
make[2]: Entering directory '/usr/src/linux-headers-4.15.0-22-generic'
arch/x86/Makefile:156: CONFIG_X86_X32 enabled but no binutils support
./scripts/gcc-version.sh: line 26: gcc: command not found
./scripts/gcc-version.sh: line 27: gcc: command not found
make[2]: gcc: Command not found
Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  CC [M]  /home/username/Documents/r8169-6.025.03/src/r8169_n.o
/bin/sh: 1: gcc: not found
scripts/Makefile.build:332: recipe for target '/home/username/Documents/r8169-6.025.03/src/r8169_n.o' failed
make[3]: *** [/home/username/Documents/r8169-6.025.03/src/r8169_n.o] Error 127
Makefile:1552: recipe for target '_module_/home/username/Documents/r8169-6.025.03/src' failed
make[2]: *** [_module_/home/username/Documents/r8169-6.025.03/src] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-22-generic'
Makefile:61: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/username/Documents/r8169-6.025.03/src'
Makefile:41: recipe for target 'modules' failed
make: *** [modules] Error 2

如果我继续执行 sudo make install 我会收到错误:

make -C src/ install
make[1]: Entering directory '/home/username/Documents/r8169-6.025.03/src'
make -C /lib/modules/4.15.0-22-generic/build SUBDIRS=/home/username/Documents/r8169-6.025.03/src INSTALL_MOD_DIR=kernel/drivers/net/ethernet/realtek modules_install
make[2]: Entering directory '/usr/src/linux-headers-4.15.0-22-generic'
arch/x86/Makefile:156: CONFIG_X86_X32 enabled but no binutils support
Makefile:976: "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel"
  DEPMOD  4.15.0-22-generic
make[2]: Leaving directory '/usr/src/linux-headers-4.15.0-22-generic'
make[1]: Leaving directory '/home/username/Documents/r8169-6.025.03/src'

所以我的问题是,为什么内置内核模块不支持千兆连接?另外,我该怎么办? Debian 论坛建议您必须加载 realtek 固件才能获得千兆性能。提前谢谢 :)。

更新:2018 年 6 月 12 日 此时,我安装了缺少的依赖项,并尝试了 realtek r8169 驱动程序和 r8168dkms 驱动程序,结果相同。我尝试使用已知良好的 (KG) cat 6 电缆,该电缆在另一个 Ubuntu 16.04 系统上以千兆位连接。我在运行固件版本 V1.0.9.26_10.2.31 的 Netgear Nighthawk R7000 路由器中测试了它们。我甚至直接连接到电缆调制解调器。我尝试使用 sudo ethtool -s enp1s0 speed 1000 duplex full 强制千兆位,我也进入了路由器设置并将我的机器设置为最高优先级。结果是一样的。100 MBits。

答案1

我遇到了同样的问题,18.04 内置r8169驱动程序无法协商千兆速度。然后我在内核日志中发现了这一点(dmesg | grep r8169):

[    3.484886] r8169 0000:01:00.0 eth0: RTL8168g/8111g at 0x        (ptrval), 84:39:be:65:a4:1c, XID 0c000800 IRQ 119
[    3.484891] r8169 0000:01:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

我觉得驱动程序很难找到 NIC 的地址/端口号 (?)。幸运的是,再次尝试初始化后问题就解决了。也许是时间问题?

我所做的是添加几行rc.local以强制重新加载r8169内核模块:

rmmod r8169
sleep 2
modprobe r8169

然后内核日志变成这样:

[   24.366692] r8169 0000:01:00.0 eth0: RTL8168g/8111g at 0x00000000955f6cfd, 84:39:be:65:a4:1c, XID 0c000880 IRQ 119
[   24.366700] r8169 0000:01:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

从现在起,它以千兆速度运行,不再出现任何问题。
希望这能有所帮助。

答案2

看起来您目前有几个错误阻止您编译和安装驱动程序(但可能还有其他错误,我无法从给出的信息中判断)。

  1. ./scripts/gcc-version.sh: line 26: gcc: command not found。看来您还没有gcc安装。运行apt install gcc

  2. "Cannot use CONFIG_STACK_VALIDATION=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel" 看起来您也需要安装这些包。

  3. CONFIG_X86_X32 enabled but no binutils support。您可能没有binutils安装包,或者可能需要binutils-dev包。

答案3

您尝试安装的驱动程序仅适用于内核版本高达 4.7。

Ubuntu 提供的 r8169 驱动程序已知存在以太网断开连接的缺陷已有一段时间了。

您使用了错误的以太网电缆,或者插入了非千兆网络交换机/集线器/路由器。

或者您需要安装r8168-dkms来解决您的问题。

答案4

经过大约一周的调查,我发现铜 RJ45 直通!!是的,不是电缆、驱动程序、内核或网络配置,而是不管你信不信,请先试着改变一下
这种情况:
通常情况下:正在运行100mb 或更少(不多)
我尝试(无效):

  • 通过否定来强制(对每一方)
  • 强制为 1GB(直接)(每边)

铜 RJ45 直通

相关内容