升级内核3.10到5.6后,无法识别网卡。表现:ip addr后无显示相关网卡
原因: 内核默认使用centos的网卡驱动r8169,但实际网卡是r8168,驱动不匹配.
boot.log爆错:Failed to start LSB: Bring up/down networking
#dmesg -d
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
查看使用的网卡驱动: # lspci -v
–拉到最后,能看到这样的信息(默认是显示r8169的,这里已经是我重装驱动后的结果了)

解决方案:
- 到官网下载匹配的最新的网卡驱动: https://www.realtek.com/zh-tw/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software
下载后解压,直接运行autorun.sh - 如果安装爆错/lib/modules/xxx/kernel/build No such file or directory, 安装kernel-devel包和kernel-headers包
命令:
# yum --disablerepo=’*’ --enablerepo=elrepo-kernel install kernel-ml-devel
# yum remove kernel-headers
# yum --disabler

在将CentOS7的内核从3.10升级到5.6后,系统无法识别网卡,原因是驱动不匹配。默认使用的是r8169驱动,而实际网卡为r8168。解决方案包括:从Realtek官网下载匹配的最新驱动,安装kernel-devel和kernel-headers包,以及gcc,然后运行autorun.sh脚本。尽管elrepo提供相关包,但在本例中并未解决问题。在旧内核3.10下,r8168驱动工作正常,但在新内核5.6下加载失败。

2350

被折叠的 条评论
为什么被折叠?



