步骤1

步骤1

这个问题经过了大量编辑。起初我以为我只有在使用网络管理器时才会遇到问题,但事实证明我的 wifi USB 适配器无法与现有驱动程序正常工作。因此,这个问题已更新,目的是找到一个有效的驱动程序。

我的 USB wifi 适配器是:TP-LINK TL-WN8200ND v1.0

到目前为止,我已经花了很多时间寻找可用的驱动程序。这似乎是一个常见问题。

许多人声称安装此驱动程序后它就可以正常工作:

https://github.com/Mange/rtl8192eu-linux-driver/

但安装此驱动程序后,我的适配器甚至没有显示在sudo lshw -c network

其他人建议:

https://github.com/jeremyb31/rtl8192eu-linux-driver

它针对 TL-WN8200ND 进行了一些特殊更改,但对我来说不起作用(适配器仍然没有显示)。

另一个标准的 goto 驱动程序似乎是:

https://github.com/pvaret/rtl8192cu-fixes

但是 README 特别提到不支持 TL-WN8200ND。安装此驱动程序确实有效。

> sudo lshw -c network
*-network
    description: Ethernet interface
    product: Ethernet Connection I217-LM
    vendor: Intel Corporation
    physical id: 19
    bus info: pci80000:00:19.0
    logical name: enp0s25
    serial: d0:50:99:c0:84:7c
    capacity: 1Gbit/s
    width: 32 bits
    clock: 33MHz
    capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotation
    configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-4 latency=0 link=no multicast=yes port=twisted pair resources: irq:25 memory:efd00000-efd1ffff memory:efd3c000-efd3cfff ioport:f080(size=32)
*-network DISABLED
    description: Ethernet interface
    product: I210 Gigabit Network Connection
    vendor: Intel Corporation
    physical id: 0
    bus info: pci80000:02:00.0
    logical name: enp2s0
    version: 03
    serial: d0:50:99:c0:84:7d
    capacity: 1Gbit/s
    width: 32 bits
    clock: 33MHz
    capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotation
    configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k firmware=3.16, 0x800004d6 latency=0 link=no multicast=yes port=twisted pair resources: irq:18 memory:efc00000-efc7ffff ioport:e000(size=32) memory:efc80000-efc83fff
*-network
    description: Wireless interface
    physical id: 1
    bus info: usb03:12
    logical name: wlx10feed2228ac
    serial: 10:fe:ed:22:28:ac
    capabilities: ethernet physical wireless
    configuration: broadcast=yes driver=rtl8192cu multicast=yes wireless=unassociated

> nmcli device
DEVICE             TYPE        STATE            CONNECTION
wlx10feed2228ac    wifi        disconnected     --

它还可以扫描所有 WiFi 网络,包括我的网络:

> nmcli device wifi list
IN-USE    SSID      MODE   CHAN  RATE        SIGNAL   BARS    SECURITY
          Totoro    Infra  6     195 Mbit/s  100      ****    WPA2

但是当我尝试连接时,它不起作用:

> nmcli device wifi connect Totoro --ask
Password: <I'm entering my password here (tested with other devices)>
Error: Connection activation failed: (7) Secrets were required, but not provided.

> dmesg
.....
usbcore: registered new interface driver rtl8192cu
rtl8192cu 3-12:1.0 wlx10feed2228ac: renamed from wlan0
.....
random: crng init done
random: 7 urandom warning(s) missed due to ratelimiting
.....
new mount options do not match the existing superblock, will be ignored
IPv6: ADDRCONF(NETDEV_UP): wlx10feed2228ac: link is not ready
.....

> journalctl -xe
wpa_supplicant: wlx10feed2228ac: Authentication with xx:xx:xx:xx:xx:xx timed out
wpa_supplicant: wlx10feed2228ac: CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1
wpa_supplicant: wlx10feed2228ac: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Totoro" auth_failures=2 duration=20 reason=CONN_FAILED
NetworkManager <warn> sup-iface [...,wlx10feed2228ac]: connection disconnected (reason -3)
NetworkManager <warn> device (wlx10feed2228ac): Activation: (wifi) association took too long

我确实读到过其他人也遇到了这个驱动程序的相同问题,所以我猜这就是“不受支持”的部分。

我确实在某个地方读过有人重写的安装自定义驱动程序的建议:

https://github.com/FreedomBen/rtl8188ce-linux-driver

但安装时提示没有检测到wifi卡然后失败。

我没主意了。我也觉得我尝试了很多方法(将驱动程序添加到黑名单、设置不同的启动选项、编辑不同的文件、安装和删除驱动程序、更改电源管理、更改随机 mac 生成),但我不确定系统的状态是什么。

pvaret 驱动程序几乎可以正常工作。检测到适配器。Wifi 扫描工作正常。只是连接不知何故失败了。在这个驱动程序的 repo 中,他们建议尝试“新”官方驱动程序,但考虑到我对系统所做的一切,我不确定如何再次安装官方驱动程序。

我更改或创建的附加信息和文件(当前状态):

> dkms status
8192cu, 1.11, 4.15.0-72-generic, x86_64: installed
8192cu, 4.0.2.9: added
rtl8192eu, 1.0, 4.15.0-72-generic, x86_64: installed (WARNING! Diff between built and installed module!)


> lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8006 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0461:0010 Primax Electronics, Ltd HP PR1101U / Primax PMX-KPR1101U Keyboard
Bus 003 Device 002: ID 2357:0100
Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


> sudo lshw -short
....
/0/100/14/0/c                      generic     802.11n WLAN Adapter
....
/1               wlx10feed2228ac   network     Wireless interface

> sudo lshw -c generic
*-usb:0
    description: Generic USB device
    product: 802.11n WLAN Adapter
    vendor: Realtek
    physical id: c
    bus info: usb03:c
    version: 2.00
    serial: 0De04c000001
    capabilities: usb-2.00
    configuration: driver=rtl8192cu maxpower=500mA speed=400Mbit/s


> cat /etc/network/interfaces
allow-hotplug wlx10feed2228ac
auto wlx10feed2228ac

iface wlx10feed2228ac inet dhcp


> cat /etc/netplan/*.yaml
network:
    ethernets:
        enq0s25:
            dhcp4: true
    version: 2


> cat /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
[connection]
wifi.powersave = 2


> cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown.keyfile

[ifupdown]
managed=false

[device]
wifi.scan-rand-mac-address=no


> ls /etc/modprobe.d/
8192eu.conf    blacklist-ath_pci.conf    blacklist-firewire.conf
blacklist-native-rtl8192.conf    dkms.conf    iwlwifi.conf
rtl8192cu.conf    amd64-microcode-blacklist.conf    blacklist.conf
blacklist-framebuffer.conf    blacklist-rare-network.conf    intel-microcode-blacklist.conf
mdadm.conf    rtl8xxxu.conf


> cat /etc/modprobe.d/8192eu.conf
options 8192eu rtw_power_mgnt=0 rtw_enusbss=0


> cat /etc/modprobe.d/blacklist-native-rtl8192.conf
install rtl8192cu /bin/false
install rtl8192c_common /bin/false
install rtl8xxxu /bin/false


> cat /etc/modprobe.d/rtl8192cu.conf
blacklist rtl8192cu


> cat /etc/modprobe.d/rtl8xxxu.conf
blacklist rtl8xxxu

按照@heynnema 的步骤

步骤 1(已完成,问题尚未解决):

  • /etc/network/interfaces已更改
  • /etc/netplan/50-cloud-init.yaml配置
  • sudo netplan --debug generate运行无错误
  • sudo netplan apply完毕
  • reboot完毕

测试连接:

> ping 8.8.8.8
connect: Network is unreachable


> sudo netplan try
Job for [email protected] canceled

An error occurred: Command '['systemctl', 'stop', 'systemd-networkd.service', 'netplan-wpa@*.service']' returned non-zero exit status 1.
Reverting.
Warning: Stopping systemd-networkd.service, but it can still be activated by:
    systemd-networkd.socket

第 2 步(准备开始)

> dkms status
8192cu, 1.11, 4.15.0-72-generic, x86_64: installed
8192cu, 4.0.2.9: added
rtl8192eu, 1.0, 4.15.0-72-generic, x86_64: installed (WARNING! Diff between built and installed module!)
  • sudo dkms remove 8192cu/1.11 --all完毕
  • sudo dkms remove 8192cu/4.0.2.9 --all完毕
  • sudo dkms remove rtl8192eu/1.0 --all完毕

检查dkms status没有返回任何内容

> dpkg -l wpa* | grep ii
ii  wpasupplicant 2:2.6-15ubuntu2.5 amd64     client support for WPA and WPA2 (IEEE 802.11i)
  • sudo -H nano /etc/modprobe.d/8192eu.conf注释掉
  • sudo -H nano /etc/modprobe.d/blacklist-native-rtl8192.conf注释掉
  • sudo -H nano /etc/modprobe.d/rtl8192cu.conf注释掉
  • sudo -H nano /etc/modprobe.d/rtl8xxxu.conf注释掉
  • reboot完毕

输出:

> sudo lshw -C network
*-network
    description: Ethernet interface
    product: Ethernet Connection I217-LM
    vendor: Intel Corporation
    physical id: 19
    bus info: pci80000:00:19.0
    logical name: enp0s25
    version: 05
    serial: d0:50:99:c0:84:7c
    capacity: 1Gbit/s
    width: 32 bits
    clock: 33MHz
    capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotation
    configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k firmware=0.13-4 latency=0 link=no multicast=yes port=twisted pair resources: irq:26 memory:efd00000-efd1ffff memory:efd3c000-efd3cfff ioport:f080(size=32)
*-network
    description: Ethernet interface
    product: I210 Gigabit Network Connection
    vendor: Intel Corporation
    physical id: 0
    bus info: pci80000:02:00.0
    logical name: enp2s0
    version: 03
    serial: d0:50:99:c0:84:7d
    capacity: 1Gbit/s
    width: 32 bits
    clock: 33MHz
    capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotation
    configuration: autonegotiation=on broadcast=yes driver=igb driverversion=5.4.0-k firmware=3.16, 0x800004d6 latency=0 link=no multicast=yes port=twisted pair resources: irq:18 memory:efc00000-efc7ffff ioport:e000(size=32) memory:efc80000-efc83fff
*-network
    description: Wireless interface
    physical id: 1
    bus info: usb03:12
    logical name: wlx10feed2228ac
    serial: 10:fe:ed:22:28:ac
    capabilities: ethernet physical wireless
    configuration: broadcast=yes driver=rtl8192cu driverversion=4.15.0-72-generic firmware=N/A link=no multicast=yes wireless=IEEE 802.11

测试:

> 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: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 cdic fq_code1 state DOWN group default qlen 1000
    link/ether d0:50:99:c0:84:7c brd ff:ff:ff:ff:ff:ff
 3: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdic mq state DOWN group default qlen 1000
    link/ether d0:50:99:c0:84:7d brd ff:ff:ff:ff:ff:ff
 4: wlx10feed2228ac: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdic mq state DOWN group default qlen 1000
    link/ether 10:fe:ed:22:28:ac brd ff:ff:ff:ff:ff:ff

扫描 wifi 网络(有效并返回 19 个网络 - 选择减少到我的 / “Totoro”):

> sudo iwlist wlx10feed2228ac scan | less
....
Cell 15 - Address: xx:xx:xx:xx:xx:xx
          Channel: 6
          Frequency: 2.437 Ghz (Channel 6)
          Quality= 70/70 Signal level=37 dBm
          Encryption key:on
          ESSID:"Totoro"
          Bit Rates: 1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s
          Bit Rates: 24 Mb/s; 36 Mb/s; 40 Mb/s; 54 Mb/s
          Mode: Master
          Extra:tsf=...
          Extra: Last beacon: 16676ms ago
          IE: Unknown: ....
          ....
          IE: IEEE 802.11i/WPA2 Version 1
               Group Cipher : CCMP
               Pairwise Ciphers (1) : CCMP
               Authentication Suites (1) : PSK
....

答案1

好的,您在 /etc/modprobe.d 中遇到了一堆相互冲突的驱动程序和模块。需要花一些时间才能解决所有问题,并且可能需要多次重写此答案才能完成所有操作。游戏?

您混合使用了 NetworkManager 和 Netplan 命令,但我们将切换到使用 Netplan 而不是 NetworkManager,并暂时使用您现在安装的驱动程序。

步骤1


首先,编辑 /etc/network/interfaces...

sudo -H gedit /etc/network/interfaces

消除...

allow-hotplug wlx10feed2228ac
auto wlx10feed2228ac

iface wlx10feed2228ac inet dhcp

现在,添加...

auto lo
iface lo inet loopback

然后编辑 /etc/netplan/*.yaml

ls -al /etc/netplan# 获取 .yaml 文件名

sudo -H gedit /etc/netplan/found_filename.yaml# 在这里使用真实的文件名

并改变这一点...

network:
    ethernets:
        enq0s25:
            dhcp4: true
    version: 2

对此...

注意:在密码字段中输入正确的密码

注意:确保间距/缩进保持不变,并且没有制表符

network:
  renderer: networkd
  version: 2
  ethernets:
    enp2s0:
      dhcp4: true
      optional: true
    enp0s25:
      dhcp4: true
      optional: true
  wifis:
    wlx10feed2228ac:
      dhcp4: true
      access-points:
        "Totoro":
          password: "**********"

sudo netplan --debug generate# 生成配置文件

sudo netplan apply# 如果没有生成错误,则应用新配置

reboot# 重启计算机

注意:我不一定期望这会起作用...但谁知道呢...第二步即将到来。

第2步


现在我们需要删除 dkms 驱动程序,然后重新使用内置驱动程序。实际上至少有两个驱动程序可以运行此无线适配器,我们可能必须将其中一个列入黑名单。

dkms status# 查看当前情况

sudo dkms remove 8192cu/1.11 --all

sudo dkms remove 8192cu/4.0.2.9 --all

sudo dkms remove rtl8192eu/1.0 --all

dkms status# 现在应该不返回任何内容


撤消模组/etc/modprobe.d……

对于以下文件...

sudo -H gedit /etc/modprobe.d/8192eu.conf

sudo -H gedit /etc/modprobe.d/blacklist-native-rtl8192.conf

sudo -H gedit /etc/modprobe.d/rtl8192cu.conf

sudo -H gedit /etc/modprobe.d/rtl8xxxu.conf

注释掉其内容,但不要删除这些文件。

reboot

然后显示当前状态:

sudo lshw -C network


步骤 #3(待定)


创建此文件...

sudo -H gedit /etc/modprobe.d/dongle.conf

添加此内容...

blacklist rtl8192cu
# blacklist rtl8xxxu

相关内容