我的台式电脑上有一个基于 rtl8821ae 的 5GHz WiFi 卡(它是 pci-e TP-Link Archer T4E)
我想在这个桌面上安装并使用 Linux。我尝试了不同的流行发行版(Ubuntu、Fedora、Manjaro 等),但它们都存在相同的问题:wi-fi 速度慢。我在 google 上搜索并尝试从 GitHub 构建一些驱动程序,但我找到的驱动程序适用于 rtl8821aU(USB 版本),而我的卡是 PCI-e。
我几乎要放弃了,但尝试了 Linux Mint Cinnamon,最后 Wi-Fi 按预期全速工作了!然后我假设 Linux Mint 使用一些特殊的驱动程序。我决定需要弄清楚 Linux Mint 使用的是哪一个,以便可以自由选择发行版。
我在这里找到了答案:如何查明安装了哪个 Wi-Fi 驱动程序?
下面是我的 Ubuntu 输出(Wi-Fi 速度非常慢):
user@ubnt:~$ sudo lshw -class network
[sudo] password for user:
*-network
description: Wireless interface
product: RTL8812AE 802.11ac PCIe Wireless Network Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlp2s0
version: 01
serial: xx:xx:xx:xx:xx:xx
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtl8821ae driverversion=5.8.0-48-generic firmware=N/A ip=xx.xx.xx.xx latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:158 ioport:e000(size=256) memory:df400000-df403fff
user@ubnt:~$ lsmod | grep rtl8821ae
rtl8821ae 233472 0
btcoexist 155648 1 rtl8821ae
rtl_pci 28672 1 rtl8821ae
rtlwifi 94208 3 rtl_pci,rtl8821ae,btcoexist
mac80211 905216 3 rtl_pci,rtl8821ae,rtlwifi
user@ubnt:~$ modinfo rtl8821ae
filename: /lib/modules/5.8.0-49-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rtl8821ae.ko
firmware: rtlwifi/rtl8821aefw_29.bin
firmware: rtlwifi/rtl8821aefw.bin
description: Realtek 8821ae 802.11ac PCI wireless
license: GPL
author: Realtek WlanFAE <[email protected]>
srcversion: 64BDAFD5093CE917B32291C
alias: pci:v000010ECd00008821sv*sd*bc*sc*i*
alias: pci:v000010ECd00008812sv*sd*bc*sc*i*
depends: rtlwifi,rtl_pci,btcoexist,mac80211
retpoline: Y
intree: Y
name: rtl8821ae
vermagic: 5.8.0-49-generic SMP mod_unload modversions
sig_id: PKCS#7
signer: Build time autogenerated kernel key
sig_key: 1A:D5:E6:56:CF:B6:5E:AF:60:74:90:89:34:8C:97:0F:89:36:10:FB
sig_hashalgo: sha512
signature: 2C:62:21:33:F2:14:BA:C9:6D:A9:71:6F:92:6D:DE:4C:F5:B7:57:C5:
BE:A2:F1:61:99:31:DE:15:3B:E2:42:41:FA:15:1D:2D:24:6F:6F:C6:
B8:4B:2F:92:21:F8:D5:B6:E2:6E:9B:42:86:F1:43:CE:FC:DF:87:F8:
8D:DC:BB:65:A3:5E:7C:42:2C:46:CA:EB:48:59:44:A7:83:36:91:6A:
C8:21:AC:F7:CD:71:7C:E4:59:FF:11:E4:4A:2B:C5:AF:FD:88:EE:F7:
8E:B8:FA:A6:B8:A9:35:5F:76:A4:8A:D7:63:E0:37:74:BE:91:34:F1:
E6:F8:DB:6F:D5:AF:3D:C6:29:26:51:95:8F:3C:4F:65:A5:05:0B:19:
20:ED:1D:D2:F0:FF:F1:F1:06:C3:51:06:20:2F:40:11:E6:12:C4:96:
1F:C1:C5:58:7D:09:10:C3:17:DE:31:51:2E:14:DE:92:20:40:62:D2:
0A:D6:52:73:37:10:28:30:EA:47:28:53:51:2D:5C:C2:F7:10:E2:44:
58:67:83:6B:F1:5D:01:A4:A6:B2:EC:B7:FD:CC:A4:A9:DD:71:13:91:
52:E0:77:A6:E6:1A:4A:27:B0:0A:59:EF:EF:28:D4:E3:CE:A9:8F:DD:
F5:A0:FF:91:02:E6:E4:2E:D9:08:90:F0:AB:E2:67:AA:B1:54:A2:7E:
8A:77:97:FB:93:1C:85:CC:E5:18:CE:F9:AC:47:9E:8D:D3:2F:9C:11:
16:38:E6:DC:BA:D6:8C:C7:EA:B9:38:EE:27:00:AE:66:FE:CB:79:E0:
43:66:2D:5C:88:AE:BD:07:49:08:F2:4E:4D:BF:FE:48:3E:6D:14:3A:
CC:DE:7D:02:8A:6E:E6:72:69:FB:65:30:36:35:DD:5B:FA:DD:1B:F4:
B5:F2:56:05:A6:58:C0:31:0A:93:BB:05:F1:B4:5D:0A:32:4A:38:46:
1B:9F:F9:27:8B:A0:56:CE:14:8B:84:C8:56:7D:24:FD:50:0F:6E:E8:
E8:5F:9E:7C:C1:6B:50:AB:68:BE:23:3F:27:84:82:B1:64:6C:DF:C5:
CC:6B:33:7C:B4:5E:1A:8D:61:E1:D9:58:EA:3F:19:DD:C9:92:ED:18:
FC:A4:96:94:EF:F4:C1:9F:63:E8:E9:83:2B:CF:DC:28:38:F6:86:C4:
20:7C:C6:8E:F7:64:CE:D9:B0:F1:19:D8:E2:1F:EB:77:3D:24:C3:93:
23:FC:69:16:DA:27:64:6F:92:88:91:EA:25:FF:BB:F1:30:19:0F:74:
68:C1:EB:C1:F0:A5:2C:F7:F4:03:30:72:50:28:EB:54:F0:84:F6:17:
60:27:3F:54:89:E1:25:A8:07:12:AC:0B
parm: swenc:Set to 1 for software crypto (default 0)
(bool)
parm: ips:Set to 0 to not use link power save (default 1)
(bool)
parm: swlps:Set to 1 to use SW control power save (default 0)
(bool)
parm: fwlps:Set to 1 to use FW control power save (default 1)
(bool)
parm: msi:Set to 1 to use MSI interrupts mode (default 1)
(bool)
parm: aspm:Set to 1 to enable ASPM (default 1)
(int)
parm: debug_level:Set debug level (0-5) (default 0) (int)
parm: debug_mask:Set debug mask (default 0) (ullong)
parm: disable_watchdog:Set to 1 to disable the watchdog (default 0)
(bool)
parm: int_clear:Set to 0 to disable interrupt clear before set (default 1)
(bool)
现在表现良好的 Linux Mint 的输出:
mint@mint:~/Desktop$ sudo lshw -class network
*-network
description: Wireless interface
product: RTL8812AE 802.11ac PCIe Wireless Network Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: wlp2s0
version: 01
serial: xx:xx:xx:xx:xx:xx
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtl8821ae driverversion=5.4.0-58-generic firmware=N/A ip=xx.xx.xx.xx latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:159 ioport:e000(size=256) memory:df400000-df403fff
mint@mint:~/Desktop$ lsmod | grep rtl8821ae
rtl8821ae 233472 0
btcoexist 155648 1 rtl8821ae
rtl_pci 28672 1 rtl8821ae
rtlwifi 90112 3 rtl_pci,rtl8821ae,btcoexist
mac80211 843776 3 rtl_pci,rtl8821ae,rtlwifi
mint@mint:~$ modinfo rtl8821ae
filename: /lib/modules/5.4.0-58-generic/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/rtl8821ae.ko
firmware: rtlwifi/rtl8821aefw_29.bin
firmware: rtlwifi/rtl8821aefw.bin
description: Realtek 8821ae 802.11ac PCI wireless
license: GPL
author: Realtek WlanFAE <[email protected]>
srcversion: A8B43BD1DD5C4F8EC9C4F6A
alias: pci:v000010ECd00008821sv*sd*bc*sc*i*
alias: pci:v000010ECd00008812sv*sd*bc*sc*i*
depends: rtlwifi,rtl_pci,btcoexist,mac80211
retpoline: Y
intree: Y
name: rtl8821ae
vermagic: 5.4.0-58-generic SMP mod_unload
sig_id: PKCS#7
signer: Build time autogenerated kernel key
sig_key: 4F:99:95:CB:A3:36:65:3E:1E:5A:30:73:58:12:C3:10:81:02:EA:FF
sig_hashalgo: sha512
signature: 04:58:B3:93:74:BB:47:4C:44:EC:B9:B4:BF:41:D8:2F:78:10:5E:74:
CD:E2:93:42:71:D7:48:C7:ED:DA:9C:80:00:BB:DF:99:2A:44:0C:CB:
BF:79:2E:05:FD:61:CA:E7:3F:5A:C0:5D:1B:78:31:41:88:44:A4:6A:
82:A8:51:64:AA:12:6F:1A:F2:09:E8:C1:5E:CF:BA:52:2F:8E:1D:DF:
D9:93:8E:51:EF:4D:7E:8E:2E:D6:B1:DE:3E:05:0C:57:05:3E:3B:70:
62:F6:01:87:A0:16:41:90:AF:CA:B9:7B:98:C8:DF:E0:2A:74:C1:97:
DD:9B:23:93:C5:32:28:07:C0:72:52:C6:62:89:90:6C:A3:B2:80:E5:
DE:E5:78:C5:FF:75:C9:3F:42:53:35:E4:9A:D7:A3:82:0B:BE:B8:90:
0D:AD:0C:6D:48:A6:40:32:2E:2E:11:9D:55:C5:2A:4D:4F:40:EF:36:
B2:F7:E5:C0:2E:56:C5:8C:13:27:86:C2:F1:0E:27:0F:9A:64:EE:CA:
29:B7:A8:56:4D:7B:71:A2:B4:01:FA:1E:DC:7C:3A:B5:32:07:29:EF:
86:41:94:61:64:17:6B:DD:B8:6D:9B:7C:2D:56:9D:5E:69:7B:A1:A8:
C5:62:A5:F7:43:2D:49:D7:6A:43:3C:1B:DC:28:74:BF:0E:7E:BD:47:
41:DF:0C:9E:E0:D3:5E:A9:9C:3C:6A:67:05:57:A7:9A:00:54:07:46:
AE:53:5B:8F:8F:1C:76:AA:7E:41:FA:23:70:00:4F:BA:59:92:91:A9:
F7:7B:16:B2:0B:DB:1A:43:A4:00:EF:3A:A7:5D:D0:E9:D0:80:CF:C6:
77:0F:E7:75:99:C7:80:66:7D:94:E4:88:F1:22:26:69:D5:1E:F1:79:
C4:14:E8:B9:20:66:9C:72:DD:02:85:EA:A3:51:02:03:97:C5:65:60:
3E:E7:94:AD:A5:DA:ED:EC:34:BC:2E:41:48:BF:1C:B8:C0:3B:95:39:
A8:A8:AC:57:3C:95:91:BA:E5:38:A3:82:34:BD:85:CA:71:3D:45:4A:
4D:D7:13:54:57:9B:7B:BD:67:B2:DE:77:05:60:5D:B9:71:0E:B7:D4:
45:88:2D:F8:0C:FD:20:EF:A8:AE:51:B0:25:5F:E6:85:36:24:C0:10:
A9:49:EA:05:BD:27:C6:01:1D:83:48:03:F5:B1:08:DA:86:0F:F8:68:
BB:7E:6D:01:76:36:D1:EE:B2:F2:72:D2:9F:E6:12:E4:77:DF:5A:1C:
E4:9F:3E:14:62:DF:8F:D5:2A:A6:04:88:39:07:6E:BB:78:5A:74:2B:
F5:D3:70:56:2F:D1:09:2C:B7:48:88:FF
parm: swenc:Set to 1 for software crypto (default 0)
(bool)
parm: ips:Set to 0 to not use link power save (default 1)
(bool)
parm: swlps:Set to 1 to use SW control power save (default 0)
(bool)
parm: fwlps:Set to 1 to use FW control power save (default 1)
(bool)
parm: msi:Set to 1 to use MSI interrupts mode (default 1)
(bool)
parm: aspm:Set to 1 to enable ASPM (default 1)
(int)
parm: debug_level:Set debug level (0-5) (default 0) (int)
parm: debug_mask:Set debug mask (default 0) (ullong)
parm: disable_watchdog:Set to 1 to disable the watchdog (default 0)
(bool)
parm: int_clear:Set to 0 to disable interrupt clear before set (default 1)
(bool)
看起来驱动程序名称匹配。驱动程序版本给了我一个线索,它是来自内核的驱动程序。虽然 Ubuntu 的驱动程序模块大小(根据lsmod
)是相等的并且驱动程序版本更大,但为什么它在除 Mint 之外的任何发行版上都这么慢?我还可以检查什么来找出差异,以及如何在任何其他发行版上启用快速 Wi-Fi?现在有了 Linux Mint,我确信这是可能的。
UPD:添加modinfo
输出。不同srcversion
(如预期)。 Linux Mint 内核/驱动程序版本较旧。如果这是较新 Realtek 驱动程序/内核中的回归,那么提交错误报告的最佳位置是什么?
UPD2:如果我将 linux 内核从 5.4 更新到 5.8,wifi 会变慢。看来我需要提交一个内核错误。但在此之前我想检查一下最新的稳定内核(5.11)是否有问题。
答案1
检查您的 WiFi MTU
,使用
ip link
还要注意您的 WiFi 接口的名称。
(最大传输单元MTU
)是单次网络传输中可以发送的最大数据包的大小。如果数据包超出了 MTU
链路的容量,则必须将数据分割成多个数据包(分片)。这些多个数据包必须通过链路发送、接收、确认并在远端重新组装。如果您的链路配置错误,并且您必须对发送的每个数据包进行分段,则实际数据传输速率会下降。
以太网(有线)网络使用MTU
1500 字节。
由于 WiFi 每个数据包的额外开销(8 字节 PPPoE 标头),WiFi 使用MTU
1492。
您MTU
应该由 DHCP 服务器设置,检查路由器的配置。
您可以设置自己的MTU
(设置不会在重新启动后保留)
ip link set dev name mtu 1492
其中“name”是上面的接口名称。
这是一个例子:
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
walt@squid:~(0)$ sudo ip link set dev wlxf46d04b1790f mtu 1492
[sudo] password for walt:
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
我的 WiFi“接口名称”是“ wlxf46d04b1790f
”。