我在我的 PC 上安装了 Debian 9stretch(GNOME 桌面)64 位。安装 atheros 固件后自动检测到我的 USB 无线适配器 (TP-LINK TL-WN722N):
apt-get install firmware-atheros
但我无法连接到任何无线框架,无论它们是否受密码保护。
我插上了我的USB。它被检测到、发送身份验证、获得身份验证,但立即中止身份验证。禁用 IPV6 并没有解决我的问题。这是我的dmesg
报告:
[ 59.880805] usb 1-1.4: new high-speed USB device number 4 using ehci-pci
[ 60.005727] usb 1-1.4: New USB device found, idVendor=0cf3, idProduct=9271
[ 60.005729] usb 1-1.4: New USB device strings: Mfr=16, Product=32, SerialNumber=48
[ 60.005731] usb 1-1.4: Product: USB2.0 WLAN
[ 60.005732] usb 1-1.4: Manufacturer: ATHEROS
[ 60.005734] usb 1-1.4: SerialNumber: 12345
[ 60.324981] usb 1-1.4: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 60.325069] usbcore: registered new interface driver ath9k_htc
[ 60.348095] usb 1-1.4: firmware: direct-loading firmware ath9k_htc/htc_9271-1.4.0.fw
[ 60.629962] usb 1-1.4: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[ 60.880826] ath9k_htc 1-1.4:1.0: ath9k_htc: HTC initialized with 33 credits
[ 61.111895] ath9k_htc 1-1.4:1.0: ath9k_htc: FW Version: 1.4
[ 61.111897] ath9k_htc 1-1.4:1.0: FW RMW support: On
[ 61.111899] ath: EEPROM regdomain: 0x809c
[ 61.111900] ath: EEPROM indicates we should expect a country code
[ 61.111901] ath: doing EEPROM country->regdmn map search
[ 61.111911] ath: country maps to regdmn code: 0x52
[ 61.111912] ath: Country alpha2 being used: CN
[ 61.111912] ath: Regpair used: 0x52
[ 61.122477] ieee80211 phy0: Atheros AR9271 Rev:1
[ 61.185069] ath9k_htc 1-1.4:1.0 wlx18a6f7160a49: renamed from wlan0
[ 61.224640] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 61.361032] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 61.535923] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 61.743450] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 69.190250] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 70.360621] wlx18a6f7160a49: authenticate with 74:23:44:dc:0f:d7
[ 70.551637] wlx18a6f7160a49: send auth to 74:23:44:dc:0f:d7 (try 1/3)
[ 70.556012] wlx18a6f7160a49: authenticated
[ 75.555233] wlx18a6f7160a49: aborting authentication with 74:23:44:dc:0f:d7 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 76.872114] wlx18a6f7160a49: authenticate with 74:23:44:dc:0f:d7
[ 77.061146] wlx18a6f7160a49: send auth to 74:23:44:dc:0f:d7 (try 1/3)
[ 77.065158] wlx18a6f7160a49: authenticated
[ 82.061225] wlx18a6f7160a49: aborting authentication with 74:23:44:dc:0f:d7 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 83.775718] wlx18a6f7160a49: authenticate with 74:23:44:dc:0f:d7
[ 83.965040] wlx18a6f7160a49: send auth to 74:23:44:dc:0f:d7 (try 1/3)
[ 83.969807] wlx18a6f7160a49: authenticated
[ 88.969792] wlx18a6f7160a49: aborting authentication with 74:23:44:dc:0f:d7 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 91.207178] wlx18a6f7160a49: authenticate with 74:23:44:dc:0f:d7
[ 91.395860] wlx18a6f7160a49: send auth to 74:23:44:dc:0f:d7 (try 1/3)
[ 91.400263] wlx18a6f7160a49: authenticated
[ 93.996839] wlx18a6f7160a49: aborting authentication with 74:23:44:dc:0f:d7 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 94.061841] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
[ 94.233433] IPv6: ADDRCONF(NETDEV_UP): wlx18a6f7160a49: link is not ready
我不知道为什么会发生这种情况,也不知道为什么一次尝试多次中止。
编辑:iwconfig 报告:
enp3s0 no wireless extensions.
wlx18a6f7160a49 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
lo no wireless extensions.
答案1
不知何故,我的固件遇到了长接口名称的问题。所以我运行这个命令来阻止它:
ln -s /dev/null /etc/systemd/network/99-default.link
它起作用了。
答案2
正如其他人所说,问题是由设备获取的非标准名称引起的(即不是 wlan*)。链接 /dev/null 对我不起作用,所以我必须创建一个 udev 规则来重命名接口:
在
/etc/udev/rules.d/70-persistent-net.rules
添加:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?\*", ATTRS{product}=="802.11 n WLAN", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
调整ATTRS{product}
到您的特定设备。在这里查看如何找到它
答案3
正如其他人所说,该问题是由设备获取的非标准名称引起的(即不是 wlan*)。以下是使用时设置网络接口名称的正确方法systemd.networkd或者网络管理器。
systemd.networkd
虽然链接到/dev/null
可能会解决问题,但正确的方法是创建.link file
设备名称设置。
/etc/systemd/network/50-wlan.link
使用以下内容创建:
[Match]
Type=wlan
[Link]
Name=wlan0
重启或者重启网络查看结果:udevadm info /sys/class/net/wlan0 | grep ID_NET_NAME=
更多详细信息和调试信息可以在这里找到:https://www.freedesktop.org/software/systemd/man/systemd.link.html
网络管理器
使用 NetworkManager 时,可以通过在 /etc/udev/rules.d 目录中创建规则来实现接口重命名。
/etc/udev/rules.d/70-rename-wlan.rules
使用以下内容创建:
SUBSYSTEM=="net", ACTION=="add", KERNEL=="wlan*", NAME="wlan0"
如果一切顺利,您应该会wlan0
在reboot
.
root@bananapi:~# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group
并且您可以使用 来连接到 wifi nmcli d wifi connect MEU_WIFI_SSID password MEU_PASSWORD
。将nmcli
保持连接并在重新启动后重新连接。
答案4
接受的解决方案对我不起作用。
我通过在连接属性中禁用 IPv6 解决了该问题。跑步nm 连接编辑器,选择有问题的连接,按带有齿轮图标的按钮(在我的例子中),转到“IPv6 设置”选项卡,在“方法”字段中选择“忽略”选项。