7

I'm planning to host a hotspot on my laptop with NetworkManager on Arch Linux. It was not difficult to create a hotspot configuration. However, when I was attempting to activate the created hotspot connection, an error occurred.

Error: Connection activation failed: 802.1X supplicant took too long to authenticate
Hint: use 'journalctl -xe NM_CONNECTION=b9ecc651-d491-414d-9c26-a3800cf2c9fd + NM_DEVICE=wlp3s0' to get more details.

I have found the journal that it suggested to check, and pasted it in the following:

-- Logs begin at Sat 2019-10-12 06:59:32 UTC, end at Sat 2020-09-26 23:29:53 UTC. --
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.0692] device (wlp3s0): set-hw-addr: set MAC address to D2:D0:FE:25:82:24 (scanning)
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1337] device (wlp3s0): Activation: starting connection 'Hotspot' (b9ecc651-d491-414d-9c26-a3800cf2c9fd)
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1349] device (wlp3s0): supplicant interface state: completed -> disconnected
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1526] device (wlp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1611] device (wlp3s0): set-hw-addr: set-cloned MAC address to 7C:7A:91:3D:C5:ED (stable)
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1639] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1643] device (wlp3s0): Activation: (wifi) access point 'Hotspot' has security, but secrets are required.
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1643] device (wlp3s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1749] device (wlp3s0): supplicant interface state: disconnected -> interface_disabled
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1769] device (wlp3s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1781] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1785] device (wlp3s0): Activation: (wifi) connection 'Hotspot' has security, and secrets exist.  No new secrets needed.
Sep 26 23:29:23 ArchPad NetworkManager[1201]: <info>  [1601162963.1817] device (wlp3s0): supplicant interface state: interface_disabled -> disconnected
Sep 26 23:29:48 ArchPad NetworkManager[1201]: <warn>  [1601162988.5177] device (wlp3s0): Activation: (wifi) Hotspot network creation took too long, failing activation
Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info>  [1601162988.5178] device (wlp3s0): state change: config -> failed (reason 'supplicant-timeout', sys-iface-state: 'managed')
Sep 26 23:29:48 ArchPad NetworkManager[1201]: <warn>  [1601162988.5199] device (wlp3s0): Activation: failed for connection 'Hotspot'
Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info>  [1601162988.5215] device (wlp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Sep 26 23:29:48 ArchPad NetworkManager[1201]: <info>  [1601162988.5263] device (wlp3s0): set-hw-addr: set MAC address to 6E:7F:89:23:28:29 (scanning)

It seems that wpa_supplicant takes too much time to set-up the hotspot. I have checked the configuration of the hotspot connection, I don't think there is anything related to supplicant-timeout:

connection.id:                          Hotspot
connection.uuid:                        b9ecc651-d491-414d-9c26-a3800cf2c9fd
connection.stable-id:                   --
connection.type:                        802-11-wireless
connection.interface-name:              wlp3s0
connection.autoconnect:                 no
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   0
connection.read-only:                   no
connection.permissions:                 --
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:                 --
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
802-11-wireless.ssid:                   TP-Link
802-11-wireless.mode:                   ap
802-11-wireless.band:                   a
802-11-wireless.channel:                7
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            --
802-11-wireless.cloned-mac-address:     stable
802-11-wireless.generate-mac-address-mask:FE:FF:FF:00:00:00
802-11-wireless.mac-address-blacklist:  --
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            --
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              0 (default)
802-11-wireless.wake-on-wlan:           0x1 (default)
802-11-wireless-security.key-mgmt:      wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg:      --
802-11-wireless-security.proto:         rsn
802-11-wireless-security.pairwise:      ccmp
802-11-wireless-security.group:         ccmp
802-11-wireless-security.pmf:           0 (default)
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0:      <hidden>
802-11-wireless-security.wep-key1:      <hidden>
802-11-wireless-security.wep-key2:      <hidden>
802-11-wireless-security.wep-key3:      <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type:  unknown
802-11-wireless-security.psk:           <hidden>
802-11-wireless-security.psk-flags:     0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
802-11-wireless-security.wps-method:    0x0 (default)
802-11-wireless-security.fils:          0 (default)
ipv4.method:                            shared
ipv4.dns:                               --
ipv4.dns-search:                        --
ipv4.dns-options:                       --
ipv4.dns-priority:                      0
ipv4.addresses:                         --
ipv4.gateway:                           --
ipv4.routes:                            --
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.routing-rules:                     --
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-iaid:                         --
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.dhcp-hostname-flags:               0x0 (none)
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            ignore
ipv6.dns:                               --
ipv6.dns-search:                        --
ipv6.dns-options:                       --
ipv6.dns-priority:                      0
ipv6.addresses:                         --
ipv6.gateway:                           --
ipv6.routes:                            --
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.routing-rules:                     --
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.ra-timeout:                        0 (default)
ipv6.dhcp-duid:                         --
ipv6.dhcp-iaid:                         --
ipv6.dhcp-timeout:                      0 (default)
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.dhcp-hostname-flags:               0x0 (none)
ipv6.token:                             --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --

Also, the model of my wireless NIC on the laptop is Intel Wireless-AC 7260, which I think is capable of hosting hotspots. Does anyone have any ideas on this problem?

Update: the problem still exists with the following logs after change the 802-11-wireless.channel to an appropriate value

-- Journal begins at Mon 2020-12-14 23:36:12 UTC, ends at Fri 2021-01-29 00:07:08 UTC. --
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3131] device (wlp3s0): Activation: starting connection 'Hotspot' (1b0ceabe-4f67-4b5a-8e09-6924744535d4)
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3134] device (wlp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3527] device (wlp3s0): set-hw-addr: reset MAC address to 7C:7A:91:A2:BB:B5 (preserve)
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3564] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3573] device (wlp3s0): Activation: (wifi) access point 'Hotspot' has security, but secrets are required.
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3575] device (wlp3s0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3598] device (wlp3s0): supplicant interface state: inactive -> interface_disabled
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3632] device (wlp3s0): supplicant interface state: interface_disabled -> inactive
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3649] device (wlp3s0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3675] device (wlp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3679] device (wlp3s0): Activation: (wifi) connection 'Hotspot' has security, and secrets exist.  No new secrets needed.
Jan 29 00:05:05 ArchPad NetworkManager[1175]: <info>  [1611878705.3911] device (wlp3s0): supplicant interface state: inactive -> disconnected
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <warn>  [1611878730.5137] device (wlp3s0): Activation: (wifi) Hotspot network creation took too long, failing activation
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info>  [1611878730.5138] device (wlp3s0): state change: config -> failed (reason 'supplicant-timeout', sys-iface-state: 'managed')
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <warn>  [1611878730.5159] device (wlp3s0): Activation: failed for connection 'Hotspot'
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info>  [1611878730.5163] device (wlp3s0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info>  [1611878730.5230] device (wlp3s0): set-hw-addr: set MAC address to B6:1B:A6:1C:81:BD (scanning)
Jan 29 00:05:30 ArchPad NetworkManager[1175]: <info>  [1611878730.5280] device (wlp3s0): supplicant interface state: disconnected -> inactive
3
  • Thanks for asking, I have a similar problem. I am working on Debian 10, though.
    – EM90
    Oct 9, 2020 at 7:19
  • 802-11-wireless.channel: 7 seems incorrect for 5GHz band (a).
    – 0andriy
    Jan 26, 2021 at 20:10
  • @0andriy I have changed the channel to 120. However, the problem still exists.
    – TJM
    Jan 29, 2021 at 0:00

2 Answers 2

6

I was also hitting this issue on Ubuntu 21.10:

>nmcli connection up bridge-slave-wlp4s0
Error: Connection activation failed: 802.1X supplicant took too long to authenticate

The only thing that ended up helping was turning on the logs for wpa_supplicant.

>wpa_cli -i wlp4s0 log_level debug
OK

After than you will start seeing debug logs in journalctl -f. Now, filter and tail the logs:

journalctl  -f -u wpa_supplicant -u NetworkManager -u systemd-networkd

Keep this open and in another session, try to activate your connection.

In my case, it turned out to be various issues related to the channel, for example, even the channel 120 suggested in another answer:

wpa_supplicant[1030]: Channel 120 (primary) not allowed for AP mode, flags: 0x17b NO-IR RADAR
wpa_supplicant[1030]: hostapd_logger: Configured channel (120) not found from the channel list of current mode (2) IEEE 802.11a
wpa_supplicant[1030]: hostapd_logger: Hardware does not support configured channel

You have to keep in mind that the valid channels will depend on many factors, including your country:

iw reg get

In my case, I had two entries:

global
country 00: DFS-UNSET
    (2402 - 2472 @ 40), (N/A, 20), (N/A)
    ...


phy#0 (self-managed)
country CA: DFS-UNSET
    (2402 - 2437 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40MINUS, NO-80MHZ, NO-160MHZ
    ...

I fixed the global one to my country with the following command:

iw reg set CA

You will get a set of frequencies available for your region and you can cross-reference with https://en.wikipedia.org/wiki/List_of_WLAN_channels to find the equivalent channel.

Now - that's wasn't all for me. Even channels that are reported valid, like 42, end up failing:

wpa_supplicant[1030]: nl80211: Set freq 5210 (ht_enabled=0, vht_enabled=0, he_enabled=0, bandwidth=0 MHz, cf1=0 MHz, cf2=0 MHz)
wpa_supplicant[1030]:   * freq=5210
wpa_supplicant[1030]:   * he_enabled=0
wpa_supplicant[1030]:   * vht_enabled=0
wpa_supplicant[1030]:   * ht_enabled=0
wpa_supplicant[1030]:   * channel_type=0
wpa_supplicant[1030]: nl80211: kernel reports: Channel is disabled
wpa_supplicant[1030]: nl80211: Failed to set channel (freq=5210): -22 (Invalid argument)

(Resulting later in the dreaded "Hotspot network creation took too long")

It turns out that even though iw reg get was guessing my region correcly, the following file wasn't set:

> cat /etc/default/crda
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=

In my case, I adjusted REGDOMAIN=CA and rebooted

Still it failed.

In the end, I noticed from the logs this debug entry:

wpa_supplicant[1029]: P2P: Add operating class 81
wpa_supplicant[1029]: P2P: Channels - hexdump(len=13): 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d
wpa_supplicant[1029]: P2P: Add operating class 124
wpa_supplicant[1029]: P2P: Channels - hexdump(len=4): 95 99 9d a1
wpa_supplicant[1029]: P2P: Add operating class 125
wpa_supplicant[1029]: P2P: Channels - hexdump(len=5): 95 99 9d a1 a5
wpa_supplicant[1029]: P2P: Add operating class 126
wpa_supplicant[1029]: P2P: Channels - hexdump(len=2): 95 9d
wpa_supplicant[1029]: P2P: Add operating class 127
wpa_supplicant[1029]: P2P: Channels - hexdump(len=2): 99 a1
wpa_supplicant[1029]: P2P: Update channel list
wpa_supplicant[1029]: P2P: channels: 81:1,2,3,4,5,6,7,8,9,10,11,12,13 124:149,153,157,161 125:149,153,157,161,165 126:149,157 127:153,161

So I tried one of the listed channels:

>nmcli connection modify bridge-slave-wlp4s0 wifi.channel 161
>nmcli connection up bridge-slave-wlp4s0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/19)

And it worked immediately.

So still don't know exactly why some of my channels are restricted, but looking at journalctl with wpa logs set to debug, you should be able to find a list of working channels.

[EDIT] After searching a bit more, I found the reason why some of the channels are unavailable. My Intel card does not support any non 20Mhz band.

This lists channels supported only in client mode:

>iw phy phy0 info | grep "no IR"
phy phy0 info | grep "no IR"
            * 5180 MHz [36] (22.0 dBm) (no IR)
            * 5200 MHz [40] (22.0 dBm) (no IR)
            * 5220 MHz [44] (22.0 dBm) (no IR)
            * 5240 MHz [48] (22.0 dBm) (no IR)
            * 5260 MHz [52] (22.0 dBm) (no IR, radar detection)
            * 5280 MHz [56] (22.0 dBm) (no IR, radar detection)
            * 5300 MHz [60] (22.0 dBm) (no IR, radar detection)
            * 5320 MHz [64] (22.0 dBm) (no IR, radar detection)
            * 5500 MHz [100] (22.0 dBm) (no IR, radar detection)
            * 5520 MHz [104] (22.0 dBm) (no IR, radar detection)
            * 5540 MHz [108] (22.0 dBm) (no IR, radar detection)
            * 5560 MHz [112] (22.0 dBm) (no IR, radar detection)
            * 5580 MHz [116] (22.0 dBm) (no IR, radar detection)
            * 5600 MHz [120] (22.0 dBm) (no IR, radar detection)
            * 5620 MHz [124] (22.0 dBm) (no IR, radar detection)
            * 5640 MHz [128] (22.0 dBm) (no IR, radar detection)
            * 5660 MHz [132] (22.0 dBm) (no IR, radar detection)
            * 5680 MHz [136] (22.0 dBm) (no IR, radar detection)
            * 5700 MHz [140] (22.0 dBm) (no IR, radar detection)
            * 5720 MHz [144] (22.0 dBm) (no IR, radar detection)

Other channels in that list will show up as disabled - so in the end, this is what I used to list my available channels:

iw phy phy0 info | grep "MHz \[" | grep -v "no IR" | grep -v "disabled"
            * 2412 MHz [1] (22.0 dBm)
            * 2417 MHz [2] (22.0 dBm)
            * 2422 MHz [3] (22.0 dBm)
            * 2427 MHz [4] (22.0 dBm)
            * 2432 MHz [5] (22.0 dBm)
            * 2437 MHz [6] (22.0 dBm)
            * 2442 MHz [7] (22.0 dBm)
            * 2447 MHz [8] (22.0 dBm)
            * 2452 MHz [9] (22.0 dBm)
            * 2457 MHz [10] (22.0 dBm)
            * 2462 MHz [11] (22.0 dBm)
            * 2467 MHz [12] (22.0 dBm)
            * 2472 MHz [13] (22.0 dBm)
            * 5745 MHz [149] (22.0 dBm)
            * 5765 MHz [153] (22.0 dBm)
            * 5785 MHz [157] (22.0 dBm)
            * 5805 MHz [161] (22.0 dBm)
            * 5825 MHz [165] (22.0 dBm)
0

I know this question is getting old, but having just come across this bug on Ubuntu 21.10 I've also found a workaround.

The problem is caused by WiFi MAC randomisation, which means the WiFi interface has to be brought down and up whenever it switches to a new AP (including creating a hotspot). This causes a rescan of the available APs, which then leads to the timeout you observe.

The workaround is to disable MAC randomisation by adding a file /etc/NetworkManager/conf.d/99-wifi.conf containing this:

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

Follow that with:

$ sudo systemctl restart NetworkManager
$ sudo systemctl restart wpa_supplicant

and you should be good to go. TBH I've no idea which of the above is necessary, if either, but they are harmless and produce a working WiFi Hotspot for me.

1
  • Adding wifi.scan-rand-mac-address=no didn't help.
    – Tomasz
    Nov 9, 2022 at 21:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .