我最近在台式电脑上安装了 Fedora,但无法获得任何以太网连接。在网上浏览了一下我的问题,发现很多人都遇到了同样的问题。在查找时,我发现缺少正确的内核模块(r8168
是正确的,而r8169
似乎是正在使用的)。
这是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 63 bytes 6605 (6.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 63 bytes 6605 (6.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
这是lspci | grep -i Ethernet
返回的内容:
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03)
返回什么lspci -nnvs 03:00.0
:
03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 03)
Subsystem: Gigabyte Technology Co., Ltd Onboard Ethernet [1458:e000]
Flags: fast devsel, IRQ 18, NUMA node 0
I/O ports at ce00 [size=256]
Memory at fdfff000 (64-bit, prefetchable) [size=4K]
Memory at fdff8000 (64-bit, prefetchable) [size=16K]
Expansion ROM at fd600000 [virtual] [disabled] [size=128K]
Capabilities: <access denied>
Kernel modules: r8169
我尝试过使用不同的内核版本但没有成功。尝试编译该r8168
模块,但该make
命令返回了大量错误,并提醒我我在 Linux 上是个菜鸟。
答案1
您的 lspci 确实显示“内核模块:r8169”,但不是“使用中的内核驱动程序:r8169”。这就引出了内核模块是否实际加载的问题。首先检查是否加载了“lsmod | grep r8”。如果没有返回任何内容,则它未加载,您可以尝试使用“sudo modprobe r8169”加载它,并使用“lsmod | grep r8”再次测试。
祝你好运。
答案2
只是回复 JdeHaan 因为命令的结果作为评论来说太长了:
[elton@fedora ~]$ sudo lspci -nnvs 03:00.0 03:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 03) Subsystem: Gigabyte Technology Co., Ltd Onboard Ethernet [1458:e000] Flags: fast devsel, IRQ 18, NUMA node 0 I/O ports at ce00 [size=256] Memory at fdfff000 (64-bit, prefetchable) [size=4K] Memory at fdff8000 (64-bit, prefetchable) [size=16K] Expansion ROM at fd600000 [virtual] [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 03-00-00-00-68-4c-e0-00 Kernel modules: r8169
我也跑了sudo journalctl -b -a -u NetworkManager | grep '2347'
但是什么也没显示..