Wifi occasionally disconnects, asks for password

I have seen it many times. Last time was yesterday. Same hardware under Windows works fine.

Wifi gets disconnected, then Wifi password window appears. If I cancel and reconnect from Networks all works again.

Can I share some logs?

@ezh Hi, in Network Manager settings for the connection, are both boxes checked to use this connection by any user etc?

The AP you connecting to is new (5G) or old (2.4G)? Windows may silently reconnect, but if it’s dropping out under linux, then the AP your connecting to may have interference from other AP’s in your locale, especially if it set to the same frequency/channel…

I just got the same issue, made a video:

Connection data:
wifi-2

I’m living in a private house, so not many AP’s are here.

The strange thing it asks for password, not just disconnects…

Wireless network hardware details might be helpful here:
inxi -Nna
The above command will report all network devices (wired and wireless).

You could watch the NetworkManager logging in a terminal for more information…
sudo journalctl -fu NetworkManager
Examine and capture the output when the disconnection event next happens. Report back here.

~> inxi -Nna
Network:
Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
vendor: Lenovo driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s lanes: 1
bus-ID: 02:00.0 chip-ID: 14c3:7961 class-ID: 0280
IF: wlp2s0 state: up mac: 20:2b:20:93:ed:6f
Info: services: NetworkManager, systemd-timesyncd, wpa_supplicant

OK, put the terminal to logging.

I get this very occasionally. Normally when I have a disconnect (and my 5G wifi is crap, so not uncommon) it reconnects either to the same access point or a different one (I have several, and I might move my laptop between spots where the signal of one gets worse and another better) without prompting for a password. But every once in a while (like less than once a week) it will give me that password prompt. My assumption has always been that there was some network glitch when attempting to authenticate with the router which it cannot distinguish from a situation where the password was wrong.

I use the following occasionally when connections, regardless 5ghz or 2.4ghz start to get slow or disconnect “randomly”:

adding a cron job as root:

* * * * * /home/<user>/check_internet.sh

check_internet.sh created as root as well:

#!/bin/bash

target_host="<your_router/modem IP>"
kernel_module="<your_wifi_kernel_module>"

check_internet_connection() 
{
    ping -c 1 -W 2 "${target_host}" >/dev/null 2>&1
}

if ! check_internet_connection; then
    modprobe -rv "${kernel_module}"
	sleep 1
	modprobe -v "${kernel_module}"
fi

Also make sure “Automatic” is not prefixed in your APs SSID and are shared for all users, after connecting to your networks.
You can play with sudo nmcli connection up "<your_ssid>", i think this one forces different channels automatically if your router is on auto regarding channel selection. Good luck!

Writing a Facebook post noticed a popup “you are offline”.

Log:
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.7772] device (wlp2s0): supplicant interface state: completed -> authenticating
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.7772] device (p2p-dev-wlp2s0): supplicant management interface state: completed -> authenticating
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.7852] device (wlp2s0): supplicant interface state: authenticating -> associating
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.7852] device (p2p-dev-wlp2s0): supplicant management interface state: authenticating -> associating
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8155] device (wlp2s0): supplicant interface state: associating -> 4way_handshake
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8155] device (p2p-dev-wlp2s0): supplicant management interface state: associating -> 4way_handshake
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8322] device (wlp2s0): supplicant interface state: 4way_handshake -> completed
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8324] device (wlp2s0): ip:dhcp4: restarting
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8324] dhcp4 (wlp2s0): canceled DHCP transaction
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8324] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8324] dhcp4 (wlp2s0): state changed no lease
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8324] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:19:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005565.8327] device (p2p-dev-wlp2s0): supplicant management interface state: 4way_handshake -> completed
янв 27 21:19:40 localhost.localdomain NetworkManager[1462]: <info>  [1738005580.8346] dhcp4 (wlp2s0): state changed no lease
янв 27 21:19:43 localhost.localdomain NetworkManager[1462]: <info>  [1738005583.6658] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63, acd pending
янв 27 21:19:43 localhost.localdomain NetworkManager[1462]: <info>  [1738005583.8422] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63
янв 27 21:19:43 localhost.localdomain NetworkManager[1462]: <info>  [1738005583.8425] policy: set 'Ezh' (wlp2s0) as default for IPv4 routing and DNS


янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8598] device (wlp2s0): supplicant interface state: completed -> authenticating
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8599] device (p2p-dev-wlp2s0): supplicant management interface state: completed -> authenticating
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8610] device (wlp2s0): supplicant interface state: authenticating -> associating
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8610] device (p2p-dev-wlp2s0): supplicant management interface state: authenticating -> associating
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8903] device (wlp2s0): supplicant interface state: associating -> associated
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.8903] device (p2p-dev-wlp2s0): supplicant management interface state: associating -> associated
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9080] device (wlp2s0): supplicant interface state: associated -> completed
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9082] device (wlp2s0): ip:dhcp4: restarting
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9232] dhcp4 (wlp2s0): canceled DHCP transaction
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9232] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9232] dhcp4 (wlp2s0): state changed no lease
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9233] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9234] device (p2p-dev-wlp2s0): supplicant management interface state: associated -> completed
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9349] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63, acd pending
янв 27 21:19:52 localhost.localdomain NetworkManager[1462]: <info>  [1738005592.9350] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  


[1738005619.8705] device (wlp2s0): supplicant interface state: completed -> authenticating
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  [1738005619.8706] device (p2p-dev-wlp2s0): supplicant management interface state: completed -> authenticating
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  [1738005619.8724] device (wlp2s0): supplicant interface state: authenticating -> associating
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  [1738005619.8724] device (p2p-dev-wlp2s0): supplicant management interface state: authenticating -> associating
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  [1738005619.9002] device (wlp2s0): supplicant interface state: associating -> 4way_handshake
янв 27 21:20:19 localhost.localdomain NetworkManager[1462]: <info>  [1738005619.9002] device (p2p-dev-wlp2s0): supplicant management interface state: associating -> 4way_handshake
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9831] device (wlp2s0): supplicant interface state: 4way_handshake -> completed
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9832] device (wlp2s0): ip:dhcp4: restarting
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9833] dhcp4 (wlp2s0): canceled DHCP transaction
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9833] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9833] dhcp4 (wlp2s0): state changed no lease
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9833] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:20:22 localhost.localdomain NetworkManager[1462]: <info>  [1738005622.9834] device (p2p-dev-wlp2s0): supplicant management interface state: 4way_handshake -> completed
янв 27 21:20:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005625.2350] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63, acd pending
янв 27 21:20:25 localhost.localdomain NetworkManager[1462]: <info>  [1738005625.2351] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63


янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9254] device (wlp2s0): supplicant interface state: completed -> authenticating
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9254] device (p2p-dev-wlp2s0): supplicant management interface state: completed -> authenticating
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9395] device (wlp2s0): supplicant interface state: authenticating -> associating
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9396] device (p2p-dev-wlp2s0): supplicant management interface state: authenticating -> associating
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9611] device (wlp2s0): supplicant interface state: associating -> associated
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9612] device (p2p-dev-wlp2s0): supplicant management interface state: associating -> associated
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9768] device (wlp2s0): supplicant interface state: associated -> completed
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9770] device (wlp2s0): ip:dhcp4: restarting
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9770] dhcp4 (wlp2s0): canceled DHCP transaction
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9770] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9771] dhcp4 (wlp2s0): state changed no lease
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9771] dhcp4 (wlp2s0): activation: beginning transaction (timeout in 45 seconds)
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9772] device (p2p-dev-wlp2s0): supplicant management interface state: associated -> completed
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9822] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63, acd pending
янв 27 21:20:38 localhost.localdomain NetworkManager[1462]: <info>  [1738005638.9823] dhcp4 (wlp2s0): state changed new lease, address=192.168.1.63

It reconnected automatically.

PS янв means January.

As I see multiple re-connections happened. But no password prompt for this time.

Is Bluetooth active somewhere nearby?

Can you run on the command line:

while :; do cat /proc/net/wireless; sleep 1; done

Let that run for ~20 seconds stop it using Ctrl-C and post the output here.

~> while :; do cat /proc/net/wireless; sleep 1; done
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   38.  -72.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   38.  -72.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   38.  -72.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   38.  -72.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   39.  -71.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   43.  -67.  -256        0      0      0      0      0        0
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
wlp2s0: 0000   38.  -72.  -256        0      0      0      0      0        0

You used Performatted text before, why not for the /proc/net/wireless dump? :wink:

Anyhow, assuming -71 is the RSSI your performance will be always suboptimal. That can be perfectly fine but if some interference comes in it will be soon large relative to your RSSI and trigger problems earlier.

You did not answer two questions yet:

My phone is near, as always. But no problems on Windows.

BTW The notebook is connected to a Ubiquity U6 LR AP (WiFi 4, 5, 6).
https://store.ui.com/us/en/products/u6-lr

For test purposes, do you observe the same ‘unstable Wi-Fi connectivity’ when using your phone as a hotpot, or connected to some other Wi-Fi network?

When not connected to your AP, I would check to see what other external Wi-Fi networks are found. Depending on the channels in use, you may be impacted by interference as marel already suggested.
nmcli device wifi rescan
nmcli device wifi list


Same place, same network, but my phone. No reconnections are happening.

~>  nmcli device wifi list
IN-USE  BSSID              SSID             MODE   CHAN  RATE        SIGNAL  BARS  SECURITY  
        D2:21:F9:23:7E:71  --               Infra  44    270 Mbit/s  57      ▂▄▆_  WPA2      
        D2:21:F9:13:7E:71  Ezh              Infra  44    270 Mbit/s  57      ▂▄▆_  WPA2      
        D2:21:F9:43:7E:71  Ezh_IOT          Infra  44    270 Mbit/s  55      ▂▄__  WPA2      
        D2:21:F9:33:7E:71  --               Infra  44    270 Mbit/s  54      ▂▄__  WPA2      
        D2:21:F9:23:7E:70  --               Infra  6     540 Mbit/s  52      ▂▄__  WPA2      
        D0:21:F9:63:7E:70  Ezh              Infra  6     540 Mbit/s  52      ▂▄__  WPA2      
        EA:B3:70:A5:FD:72  Ezh_IOT          Infra  36    270 Mbit/s  52      ▂▄__  WPA2      
        E6:B3:70:A5:FD:72  --               Infra  36    270 Mbit/s  52      ▂▄__  WPA2      
        E2:B3:70:A5:FD:72  --               Infra  36    270 Mbit/s  52      ▂▄__  WPA2      
        D2:21:F9:13:7E:70  Ezh_IOT          Infra  6     540 Mbit/s  49      ▂▄__  WPA2      
        DE:B3:70:A5:FD:72  Ezh              Infra  36    270 Mbit/s  49      ▂▄__  WPA2      
        D8:B3:70:A4:FD:72  Ezh              Infra  1     130 Mbit/s  47      ▂▄__  WPA2      
        E2:B3:70:A4:FD:72  Ezh_IOT          Infra  1     130 Mbit/s  47      ▂▄__  WPA2      
        DE:B3:70:A4:FD:72  --               Infra  1     130 Mbit/s  47      ▂▄__  WPA2      
        E4:8D:8C:F2:82:11  4G-GW11          Infra  52    270 Mbit/s  47      ▂▄__  --        
        D0:21:F9:21:E0:B4  Ezh              Infra  1     195 Mbit/s  39      ▂▄__  WPA2      
        D6:21:F9:21:E0:B4  --               Infra  1     195 Mbit/s  39      ▂▄__  WPA2      
        DA:21:F9:21:E0:B4  Ezh_IOT          Infra  1     195 Mbit/s  39      ▂▄__  WPA2      
        6E:B2:27:83:DC:94  --               Infra  132   135 Mbit/s  24      ▂___  WPA2      
        F8:5E:42:50:74:61  JETT             Infra  6     130 Mbit/s  22      ▂___  WPA1 WPA2 
        EC:A8:1F:73:C9:E1  CGA2121_H9VRstE  Infra  6     130 Mbit/s  15      ▂___  WPA1 WPA2 
        78:F2:9E:EF:27:08  786c94           Infra  5     130 Mbit/s  14      ▂___  WPA2      
        DE:21:F9:22:E0:B4  --               Infra  36    405 Mbit/s  14      ▂___  WPA2      
        E2:21:F9:22:E0:B4  Ezh_IOT          Infra  36    405 Mbit/s  14      ▂___  WPA2      
        D4:5D:DF:1A:77:A6  825178           Infra  4     130 Mbit/s  12      ▂___  WPA1 WPA2 
        B4:B0:24:6F:8A:66  Oleg             Infra  8     270 Mbit/s  12      ▂___  WPA1 WPA2 
        DA:21:F9:22:E0:B4  --               Infra  36    405 Mbit/s  12      ▂___  WPA2      
        D6:21:F9:22:E0:B4  Ezh              Infra  36    405 Mbit/s  12      ▂___  WPA2      
        C2:81:DB:BF:F9:B7  B628_F9BF        Infra  5     270 Mbit/s  10      ▂___  WPA2      
        5C:A6:E6:6C:E2:40  TP-Link_E240     Infra  11    130 Mbit/s  7       ▂___  WPA2      
        5E:A6:E6:6C:E2:40  --               Infra  11    130 Mbit/s  7       ▂___  WPA2      
        D0:21:F9:63:7E:71  --               Infra  44    270 Mbit/s  55      ▂▄__  WEP     

I have grabbed my two old notebooks and now running them on same network to see how they will behave.

On Linux the notebook gets only 33-288,2 Mbit/s (usually 144,1). Booted to Windows and got:

SSID:	Ezh
Protocol:	Wi-Fi 6 (802.11ax)
Security type:	WPA2-Personal
Network band:	5 GHz
Network channel:	44
Link speed (Receive/Transmit):	432/648 (Mbps)
Link-local IPv6 address:	fe80::be7a:b876:3c34:918d%4
IPv4 address:	192.168.1.63
IPv4 DNS servers:	192.168.1.1
Manufacturer:	MediaTek, Inc.
Description:	MediaTek Wi-Fi 6 MT7921 Wireless LAN Card
Driver version:	23.32.2.560
Physical address (MAC):	20-2B-20-93-ED-6F

Your phone indicates it is connected to “Ezh”, filtering that in the device list:

D2:21:F9:13:7E:71  Ezh     Infra  44    270 Mbit/s  57      ▂▄▆_  WPA2      
D0:21:F9:63:7E:70  Ezh     Infra  6     540 Mbit/s  52      ▂▄__  WPA2      
DE:B3:70:A5:FD:72  Ezh     Infra  36    270 Mbit/s  49      ▂▄__  WPA2      
D8:B3:70:A4:FD:72  Ezh     Infra  1     130 Mbit/s  47      ▂▄__  WPA2      
D0:21:F9:21:E0:B4  Ezh     Infra  1     195 Mbit/s  39      ▂▄__  WPA2      
D6:21:F9:22:E0:B4  Ezh     Infra  36    405 Mbit/s  12      ▂___  WPA2

So if Windows is connecting to 2G (channels <15 are 2G) while Linux is connecting to 5G things are explained. Also it looks like there are multiple AP’s on the same Network, to allow for roaming?

Forcing which MAC address to use seems to be possible but with limitations:

So maybe you should switch off the 5G of the AP and … the other AP’s with the same Network name.