我是 Ubuntu 新手用户,我正在尝试使用 netplan 进行无线连接,但我怎么也想不出为什么它不工作,通过以太网连接我没有问题。
我在一台新安装的双启动 PC 上,运行 Ubuntu Server 18.04 和 Windows 10,并使用“Intel Corporation Wireless 8260 (rev 3a)”卡。所有驱动程序等都是最新的。
这是 netplan 配置文件,我最初打算设置一个静态 IP,但由于 wifi 无法使用,我决定暂时坚持使用 dhcp:
network:
version: 2
renderer: networkd
ethernets:
enp24s0:
dhcp4: true
dhcp6: true
addresses: [192.168.1.222/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
wifis:
wlp26s0:
dhcp4: true
dhcp6: true
addresses: []
access-points:
"DBEB Hyperoptic 1Gbps Broadband":
password: "..."
抱歉,我手头只有命令的输出,而不是运行的确切命令。
Rfkill 输出显示卡未被阻止:
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
7: phy6: Wireless LAN
Soft blocked: no
Hard blocked: no
iwconfig | grep wlp26s0(显示接入点未关联)
wlp26s0 IEEE 802.11 ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Netplan 调试应用:
** (generate:2452): DEBUG: 21:20:56.349: Processing input file //etc/netplan/01-netcfg.yaml..
** (generate:2452): DEBUG: 21:20:56.349: starting new processing pass
** (generate:2452): DEBUG: 21:20:56.349: wlp26s0: adding wifi AP 'DBEB Hyperoptic 1Gbps Broadband'
** (generate:2452): DEBUG: 21:20:56.349: enp24s0: setting default backend to 1
** (generate:2452): DEBUG: 21:20:56.349: wlp26s0: setting default backend to 1
** (generate:2452): DEBUG: 21:20:56.349: Generating output files..
** (generate:2452): DEBUG: 21:20:56.349: NetworkManager: definition enp24s0 is not for us (backend 1)
** (generate:2452): DEBUG: 21:20:56.349: wlp26s0: Creating wpa_supplicant configuration file run/netplan/wpa-wlp26s0.conf
** (generate:2452): DEBUG: 21:20:56.349: Creating wpa_supplicant service enablement link /run/systemd/system/multi-user.target.wants/[email protected]
** (generate:2452): DEBUG: 21:20:56.350: NetworkManager: definition wlp26s0 is not for us (backend 1)
dmesg | grep wlp(我清楚地收到了“14=MIC_FAILURE”,但不确定如何解决这个问题)。
[ 0.064845] audit: initializing netlink subsys (disabled)
[ 1.060805] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[ 6.195188] iwlwifi 0000:1a:00.0 wlp26s0: renamed from wlan0
[ 6.559179] IPv6: ADDRCONF(NETDEV_UP): wlp26s0: link is not ready
[ 10.140355] wlp26s0: authenticate with 64:13:6c:0c:db:e8
[ 10.142026] wlp26s0: send auth to 64:13:6c:0c:db:e8 (try 1/3)
[ 10.151528] wlp26s0: authenticated
[ 10.153119] wlp26s0: associate with 64:13:6c:0c:db:e8 (try 1/3)
[ 10.164864] wlp26s0: RX AssocResp from 64:13:6c:0c:db:e8 (capab=0x411 status=0 aid=3)
[ 10.166061] wlp26s0: associated
[ 10.179938] wlp26s0: disassociated from 64:13:6c:0c:db:e8 (Reason: 14=MIC_FAILURE)
[ 21.547731] wlp26s0: authenticate with 64:13:6c:0c:db:e8
[ 21.549900] wlp26s0: send auth to 64:13:6c:0c:db:e8 (try 1/3)
[ 21.552212] wlp26s0: authenticated
[ 21.556260] wlp26s0: associate with 64:13:6c:0c:db:e8 (try 1/3)
[ 21.566382] wlp26s0: RX AssocResp from 64:13:6c:0c:db:e8 (capab=0x411 status=0 aid=3)
[ 21.567991] wlp26s0: associated
[ 21.585954] wlp26s0: disassociated from 64:13:6c:0c:db:e8 (Reason: 14=MIC_FAILURE)
抱歉发了这么长的帖子,我怀疑我的问题可能出在 netplan 文件中的错误条目。
答案1
这确实是新手错误,wifi密码不正确。
我通过运行 journalctl 解决了这个问题,它清楚地显示四次握手失败了:
journalctl | grep wpa_supplicant
wpa_supplicant[858]: wlp26s0: Trying to associate with 64:13:6c:0c:db:e8 (SSID='DBEB Hyperoptic 1Gbps Broadband' freq=2437 MHz)
wpa_supplicant[858]: wlp26s0: Associated with 64:13:6c:0c:db:e8
wpa_supplicant[858]: wlp26s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
wpa_supplicant[858]: wlp26s0: CTRL-EVENT-DISCONNECTED bssid=64:13:6c:0c:db:e8 reason=14
wpa_supplicant[858]: wlp26s0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wpa_supplicant[858]: wlp26s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="DBEB Hyperoptic 1Gbps Broadband" auth_failures=14 duration=210 reason=WRONG_KEY
wpa_supplicant[858]: wlp26s0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="DBEB Hyperoptic 1Gbps Broadband" auth_failures=15 duration=229 reason=CONN_FAILED