Ubuntu Server 20.04 无法找到/连接到隐藏接入点

Ubuntu Server 20.04 无法找到/连接到隐藏接入点

[1. 总结问题]

无法通过使用网络管理器和/或 Netplan 访问隐藏的 Wifi 接入点

[2. 提供详细信息和任何研究]

使用搭载 Ubuntu 20.04 LTS 的 Raspberry Pi 4。除了添加 RTC Hat 外,无需对硬件进行任何修改。

尝试使用网络管理器来切换/连接到多个接入点(隐藏或其他)。

[ 3. 在适当的时候,描述你尝试过的方法 ]

总结一下(不列出我过去两天的努力):

参考

添加了连接信息

sudo nmcli con add type wifi con-name Hidden_Test ifname wlp590 ssid <SSID>
Connection 'Hidden_Test' (e64a9fff-f74f-451b-9876-84a9085f9902) successfully added.

sudo nmcli con mod Hidden_Test wifi-sec.key-mgmt wpa-psk
sudo nmcli con mod Hidden_Test wifi-sec.psk <PASSWORD>
sudo nmcli con mod Hidden_Test 802-11-wireless.hidden yes
sudo nmcli con up Hidden_Test 
Error: Connection activation failed: The Wi-Fi network could not be found
Hint: use 'journalctl -xe NM_CONNECTION=e64a9fff-f74f-451b-9876-84a9085f9902 + NM_DEVICE=wlan0' to get more details.

检查 journalctl 日志

sudo journalctl -xe NM_CONNECTION=e64a9fff-f74f-451b-9876-84a9085f9902 + NM_DEVICE=wlan0

(wlan0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
(wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
(wlan0): Activation: (wifi) connection 'Hidden_Test' has security, and secrets exist.  No new secrets needed.
(wlan0): supplicant interface state: disconnected -> scanning
(wlan0): Activation: (wifi) association took too long, failing activation
(wlan0): state change: config -> failed (reason 'ssid-not-found', sys-iface-state: 'managed')
(wlan0): Activation: failed for connection 'Hidden_Test'
(wlan0): supplicant interface state: scanning -> disconnected
(wlan0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
(wlan0): set-hw-addr: set MAC address to 62:49:B2:DB:41:16 (scanning)
(wlan0): wifi-scan: active scanning for networks due to profiles with wifi.hidden=yes. This makes you trackable
(wlan0): Activation: starting connection 'Hidden_Test' (e64a9fff-f74f-451b-9876-84a9085f9902)
(wlan0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
(wlan0): set-hw-addr: reset MAC address to E4:5F:01:49:58:13 (preserve)
(wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
(wlan0): Activation: (wifi) access point 'Hidden_Test' has security, but secrets are required.
(wlan0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
(wlan0): supplicant interface state: disconnected -> disabled
(wlan0): supplicant interface state: disabled -> disconnected

看起来好像它正在查找接入点,但后来却找不到了?并且它的状态从断开变为禁用,然后又变回断开状态?

无论如何...要检查一些东西。

sudo nmcli con show Hidden_Test
...
...
802-11-wireless.hidden:                 yes
...

检查 NetworkManager.conf

sudo nano /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true

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

还有很多其他尝试,按照各种其他链接(我可以链接我浏览过的 15 多个站点)包括不添加隐藏值,一些使用不同的 nmcli 选项/设置,许多建议使用 wpa_supplicant,一些使用 wpa_supplicant.dhcp,其他人说最好使用 Netplan,我确实尝试过那条路线,但更喜欢继续使用 Network-Manager。

如果你对 .yaml 文件感兴趣

sudo nano /etc/netplan/50-cloud-init.yaml

network:
    renderer: NetworkManager
    ethernets:
        eth0:
            dhcp4: true
            optional: true
    version: 2
    wifis:
      wlan0:
        #hidden: true # only in netplan 0.100
        dhcp4: true
        access-points:
          "SSID":
             hidden: true
             password: "PASSWORD"

我注意到,使用 Netplan 和 Network-Manager 会产生奇怪的冲突,有时会创建重复的 wpa_supplicant 进程(我也读过有关它们的信息)。我还遵循了一些步骤,试图确保 Netplan 将使用 Network-Manager(如粘贴的文件中所示)。此方法在“sudo netplan generate”和“sudo netplan apply”之后将生成自己的设备/连接名称,当“sudo nmcli c up”该连接时,它会产生与前面所述的相同问题。

我在这里很茫然,而且我在许多文章中发现的大多数“解决方案”要么对作者有用,要么未经证实,无论哪种方式,它们对我来说都不起作用,所以我认为我遗漏了一些东西。

有人能帮忙解决这个问题吗?

相关内容