Score:0

Wlan0 will not connect to WiFi?

tr flag

I'm trying to run a USB Wi-Fi dongle off Ubuntu Server. I edited /etc/netplan/*.yaml and I'm running multiple network interfaces, which all work as intended. See the lines below for the Wi-Fi setting. Renderer is NetworkManager.

  wifis:
wlan0:
  access-points:
    "SSID":
      password: "********"
  dhcp4: true
  optional: true

I'm able to see the wlan0 interface and scan:

wlan0     Scan completed :
      Cell 01 - Address: 1C:43:63:26:2C:DC
                Channel:9
                Frequency:2.452 GHz (Channel 9)
                Quality=42/70  Signal level=-68 dBm
                Encryption key:on
                ESSID:"SSID"
                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; 48 Mb/s; 54 Mb/s
                Mode:Master
                Extra:tsf=0000000e5148e399
                Extra: Last beacon: 72ms ago

Logs from NetworkManager:

Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6108] device (wlan0): supplicant interface state: starting -> ready
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6111] Wi-Fi P2P device controlled by interface wlan0 created
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6117] manager: (p2p-dev-wlan0): new 802.11 Wi-Fi P2P device (/org/freedesktop/NetworkManager/Devices/5)
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6125] device (p2p-dev-wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <warn>  [1669569703.6141] sup-iface: failed to cancel p2p connect: P2P cancel failed
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6142] device (p2p-dev-wlan0): state change: unavailable -> disconnected (reason 'none', sys-iface-state: 'managed')
Nov 27 17:21:43 sp4k001 NetworkManager[2312]: <info>  [1669569703.6147] device (wlan0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')

Any ideas? I've tried with and without wpa_supplicant, but Netplan.io says you don't need wpa_supplicant when running NetworkManager backend.

I've also found the following logs in netplan-wpa-wlan0.service:

Nov 27 16:18:53 sp4k001 wpa_supplicant[3908]: wlan0: SME: Trying to authenticate with 1c:43:63:26:2c:dc (SSID='Hairy-Lemon' freq=2452 MHz)
Nov 27 16:18:53 sp4k001 wpa_supplicant[3908]: wlan0: Trying to associate with 1c:43:63:26:2c:dc (SSID='Hairy-Lemon' freq=2452 MHz)
Nov 27 16:18:53 sp4k001 wpa_supplicant[3908]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Hairy-Lemon" auth_failures=7 duration=90 reason=CONN_FAILED
Nov 27 16:20:24 sp4k001 wpa_supplicant[3908]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="Hairy-Lemon"
Nov 27 16:20:24 sp4k001 wpa_supplicant[3908]: wlan0: SME: Trying to authenticate with 1c:43:63:26:2c:dc (SSID='Hairy-Lemon' freq=2452 MHz)
Nov 27 16:20:24 sp4k001 wpa_supplicant[3908]: wlan0: Trying to associate with 1c:43:63:26:2c:dc (SSID='Hairy-Lemon' freq=2452 MHz)
Nov 27 16:20:25 sp4k001 wpa_supplicant[3908]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="Hairy-Lemon" auth_failures=8 duration=90 reason=CONN_FAILED

When I run nmcli dev wifi connect SSID password ******, it all works. Am I not able to use netplan and NetworkManager without reliance on wpa_supplicant? Any help appreciated, this seems to be a common problem for quite a few people on Ubuntu Server.

To clarify, this is not resolved via the following steps: No WiFi on IntelNUC Following Release Upgrade

Out of the box, I'm not able to set up a netplan and attach a Wi-Fi connection to an AP with PSK. See error messages above.

Score:0
tr flag

Sorry to bring this back, it was a driver issue when wpasupplicant was passing information to the an rtl82xxx driver that Ubuntu is not familiar with. I was using a TP-Link Mini N300 USB adapter, which was the cause of the strange behaviour. Edimax EW-7811 seem to work fine with their rtl8192cu chip in Ubuntu with Netplan.

Running Netplan as normal with NetworkManager renderer, with wpasupplicant installed worked well. Just make sure your devices and services aren't conflicting.

Score:0
us flag

This does not answer your question, but NetworkManager does rely on wpasupplicant for the WiFi authentication. The only difference is that if you install NetworkManager, this is pulled in automatically. If you are using networkd, then you need to manually install it.

The logs simply look like a bad wifi password. You can check under /run/NetworkManager to make sure the file emitted by netplan has the correct password, and that you're not being caught out by some yaml escaping issue.

Douglas Yeaman avatar
tr flag
I'm back on this as I'm having the same issue with another Wifi adapter. I can see the correct settings in /run/NetworkManager/. If I unplug the WiFi adapter and plug it back in, it will connect to the network successfully. I can repeat this over and over, I've also seen a bug was reported on launchpad and people are still asking about it - https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1874377
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.