![WiFi 可用,但在 Gnome 中不可用/不可见](https://linux22.com/image/1028120/WiFi%20%E5%8F%AF%E7%94%A8%EF%BC%8C%E4%BD%86%E5%9C%A8%20Gnome%20%E4%B8%AD%E4%B8%8D%E5%8F%AF%E7%94%A8%2F%E4%B8%8D%E5%8F%AF%E8%A7%81.png)
我最近在联想 ThinkPad 上安装了 Ubuntu 22.04。系统使用安装期间配置的本地 WiFi 连接(我可以正常访问互联网),但 WiFi 适配器在所有 GUI/Gnome 设置中都显示为“不可用”。iwconfig
显示 WiFi 接口(wlp4s0
)以及 WiFi SSID:
lo no wireless extensions.
enp0s31f6 no wireless extensions.
wlp4s0 IEEE 802.11 ESSID:"MySSID"
Mode:Managed Frequency:5.18 GHz Access Point: 04:42:1A:9C:92:14
Bit Rate=866.7 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=53/70 Signal level=-57 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:460 Missed beacon:0
lshw -C network
还列出了与本机驱动程序的接口(iwlwifi
):
*-network
description: Wireless interface
product: Wireless 8260
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:04:00.0
logical name: wlp4s0
version: 3a
serial: 44:85:00:f4:9d:db
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=5.15.0-50-generic firmware=36.ca7b901d.0 8000C-36.ucode ip=192.168.78.6 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:128 memory:f1000000-f1001fff
lsmod
输出以下内容:
iwlwifi 450560 1 iwlmvm
cfg80211 974848 3 iwlmvm,iwlwifi,mac80211
rfkill
说:
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 unblocked unblocked
1 bluetooth tpacpi_bluetooth_sw unblocked unblocked
2 wlan phy0 unblocked unblocked
的输出nmci d
为:
DEVICE TYPE STATE CONNECTION
wlp4s0 wifi unavailable --
enp0s31f6 ethernet unmanaged --
lo loopback unmanaged --
我的 netplan 配置文件包含以下内容(我dhcp-overrides
手动添加了本地名称服务器和部分):
# 00-installer-config-wifi.yaml
# This is the network config written by 'subiquity'
network:
version: 2
wifis:
wlp4s0:
access-points:
MySSID:
password: mypasswd
dhcp4: true
dhcp4-overrides:
use-dns: false
nameservers:
addresses: [192.168.78.42]
# 00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s31f6:
dhcp4: true
optional: true
version: 2
唯一的连接问题是,有时只有特定设备才能与系统建立本地连接(通过 SSH 或 HTTP),而其他设备则返回错误(超时/无路由到主机/主机已关闭)。/var/log/auth.log
虽然记录了成功的连接,但失败的连接尝试不会出现在 中。可以通过启动任何连接(例如 ping)暂时修复此问题从系统无法与设备建立连接,然后再次连接到系统。我不确定这是否与我的实际问题有关:
如何在 Gnome 中“激活” WiFi 适配器(例如连接到不同的 WiFi 网络)?
谢谢,Jan
答案1
要在 Gnome(实际上是网络管理器)中激活连接,请恢复所有 netplan 条目:
sudo rm /etc/netplan/00-installer-config-wifi.yaml
编写新的 netplan 文件:
sudo nano /etc/netplan/01-network-manager-all.yaml
添加以下内容:
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
接下来是:
sudo netplan generate
sudo netplan apply
sudo service NetworkManager restart
可能需要重新启动。