2

In certain wifi networks my laptop keeps reconnecting in seemingly random intervals, anytime between 1-60 minutes. In logs I am finding messages such as following:

wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-76 noise=9999 txrate=26000
NetworkManager[1177]: <info>  [1681913817.0277] dhcp4 (wlp1s0): state changed new lease, address=10.13.2.61

Why is the system deciding to drop the wifi connection? Is it because of signal strength, as indicated above (signal=-76), or is that unrelated?

It is a problem because after reconnecting to the wifi, the system obtains a new IP address, which makes all existing ssh connections freeze.

In more detail, logs from the initial connection:

Apr 19 15:45:34 xlap NetworkManager[1177]: <info>  [1681911934.3419] device (wlp1s0): supplicant interface state: 4way_handshake -> completed
Apr 19 15:45:34 xlap NetworkManager[1177]: <info>  [1681911934.3420] device (wlp1s0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "eduroam"
Apr 19 15:45:34 xlap NetworkManager[1177]: <info>  [1681911934.3420] device (p2p-dev-wlp1s0): supplicant management interface state: 4way_handshake -> completed
Apr 19 15:45:34 xlap NetworkManager[1177]: <info>  [1681911934.3422] device (wlp1s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Apr 19 15:45:34 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-58 noise=9999 txrate=26000
Apr 19 15:45:34 xlap NetworkManager[1177]: <info>  [1681911934.3462] dhcp4 (wlp1s0): activation: beginning transaction (timeout in 45 seconds)
Apr 19 15:45:34 xlap avahi-daemon[1119]: Joining mDNS multicast group on interface wlp1s0.IPv6 with address fe80::33e0:44c4:f396:7975.
Apr 19 15:45:34 xlap avahi-daemon[1119]: New relevant interface wlp1s0.IPv6 for mDNS.
Apr 19 15:45:34 xlap avahi-daemon[1119]: Registering new address record for fe80::33e0:44c4:f396:7975 on wlp1s0.*.
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4593] dhcp4 (wlp1s0): state changed new lease, address=10.13.0.162
Apr 19 15:45:35 xlap avahi-daemon[1119]: Joining mDNS multicast group on interface wlp1s0.IPv4 with address 10.13.0.162.
Apr 19 15:45:35 xlap avahi-daemon[1119]: New relevant interface wlp1s0.IPv4 for mDNS.
Apr 19 15:45:35 xlap avahi-daemon[1119]: Registering new address record for 10.13.0.162 on wlp1s0.IPv4.
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4633] device (wlp1s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4651] device (wlp1s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4652] device (wlp1s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4656] manager: NetworkManager state is now CONNECTED_LOCAL
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4666] manager: NetworkManager state is now CONNECTED_SITE
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4667] policy: set 'eduroam' (wlp1s0) as default for IPv4 routing and DNS
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4669] device (wlp1s0): Activation: successful, device activated.
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4671] manager: NetworkManager state is now CONNECTED_GLOBAL
Apr 19 15:45:35 xlap NetworkManager[1177]: <info>  [1681911935.4673] manager: startup complete

And Wifi reconnecting here with a new IP address obtained:

Apr 19 16:15:03 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-61 noise=9999 txrate=130000
Apr 19 16:15:39 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-STARTED EAP authentication started
Apr 19 16:15:39 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21 -> NAK
Apr 19 16:15:39 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
Apr 19 16:15:39 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
Apr 19 16:15:40 xlap wpa_supplicant[1179]: EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-REMOVED 00:a7:42:b9:cf:cf 0
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-REMOVED 5c:83:8f:3c:8b:f0 0
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-REMOVED 00:a7:42:b9:cf:c0 0
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-ADDED 00:a7:42:b9:cf:c0 0
Apr 19 16:15:40 xlap NetworkManager[1177]: <info>  [1681913740.2369] device (wlp1s0): supplicant interface state: completed -> 4way_handshake
Apr 19 16:15:40 xlap NetworkManager[1177]: <info>  [1681913740.2370] device (p2p-dev-wlp1s0): supplicant management interface state: completed -> 4way_handshake
Apr 19 16:15:40 xlap wpa_supplicant[1179]: wlp1s0: WPA: Key negotiation completed with 00:a7:42:b9:cf:c0 [PTK=CCMP GTK=CCMP]
Apr 19 16:15:40 xlap NetworkManager[1177]: <info>  [1681913740.3235] device (wlp1s0): supplicant interface state: 4way_handshake -> completed
Apr 19 16:15:40 xlap NetworkManager[1177]: <info>  [1681913740.3257] device (p2p-dev-wlp1s0): supplicant management interface state: 4way_handshake -> completed
Apr 19 16:15:43 xlap kernel: Rekeying PTK for STA 00:a7:42:b9:cf:c0 but driver can't safely do that.
Apr 19 16:15:43 xlap kernel: wlp1s0: deauthenticated from 00:a7:42:b9:cf:c0 (Reason: 15=4WAY_HANDSHAKE_TIMEOUT)
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-9999 noise=9999 txrate=0
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-DISCONNECTED bssid=00:a7:42:b9:cf:c0 reason=15
Apr 19 16:15:43 xlap wpa_supplicant[1179]: BSSID 00:a7:42:b9:cf:c0 ignore list count incremented to 2, ignoring for 10 seconds
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.4085] device (wlp1s0): supplicant interface state: completed -> disconnected
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.4086] device (p2p-dev-wlp1s0): supplicant management interface state: completed -> disconnected
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.4849] device (wlp1s0): supplicant interface state: disconnected -> scanning
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.4850] device (p2p-dev-wlp1s0): supplicant management interface state: disconnected -> scanning
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-ADDED 00:a7:42:b9:cf:cf 0
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-ADDED 5c:83:8f:3c:8b:f0 0
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: SME: Trying to authenticate with 00:a7:42:b9:cf:cf (SSID='eduroam' freq=5320 MHz)
Apr 19 16:15:43 xlap kernel: wlp1s0: authenticate with 00:a7:42:b9:cf:cf
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.6487] device (wlp1s0): supplicant interface state: scanning -> authenticating
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.6487] device (p2p-dev-wlp1s0): supplicant management interface state: scanning -> authenticating
Apr 19 16:15:43 xlap kernel: wlp1s0: send auth to 00:a7:42:b9:cf:cf (try 1/3)
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: Trying to associate with 00:a7:42:b9:cf:cf (SSID='eduroam' freq=5320 MHz)
Apr 19 16:15:43 xlap kernel: wlp1s0: authenticated
Apr 19 16:15:43 xlap kernel: wlp1s0: associate with 00:a7:42:b9:cf:cf (try 1/3)
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.6812] device (wlp1s0): supplicant interface state: authenticating -> associating
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.6813] device (p2p-dev-wlp1s0): supplicant management interface state: authenticating -> associating
Apr 19 16:15:43 xlap kernel: wlp1s0: RX AssocResp from 00:a7:42:b9:cf:cf (capab=0x111 status=0 aid=2)
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: Associated with 00:a7:42:b9:cf:cf
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-STARTED EAP authentication started
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Apr 19 16:15:43 xlap kernel: wlp1s0: associated
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7255] device (wlp1s0): supplicant interface state: associating -> associated
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7256] device (p2p-dev-wlp1s0): supplicant management interface state: associating -> associated
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7256] device (wlp1s0): ip:dhcp4: restarting
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7575] dhcp4 (wlp1s0): canceled DHCP transaction
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7576] dhcp4 (wlp1s0): activation: beginning transaction (timeout in 45 seconds)
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7576] dhcp4 (wlp1s0): state changed no lease
Apr 19 16:15:43 xlap NetworkManager[1177]: <info>  [1681913743.7577] dhcp4 (wlp1s0): activation: beginning transaction (timeout in 45 seconds)
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=21 -> NAK
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=25
Apr 19 16:15:43 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-METHOD EAP vendor 0 method 25 (PEAP) selected
Apr 19 16:15:43 xlap kernel: wlp1s0: Limiting TX power to 17 dBm as advertised by 00:a7:42:b9:cf:cf
Apr 19 16:15:44 xlap wpa_supplicant[1179]: EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-REMOVED 00:a7:42:b9:cf:cf 0
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: PMKSA-CACHE-ADDED 00:a7:42:b9:cf:cf 0
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: WPA: Key negotiation completed with 00:a7:42:b9:cf:cf [PTK=CCMP GTK=CCMP]
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-CONNECTED - Connection to 00:a7:42:b9:cf:cf completed [id=0 id_str=]
Apr 19 16:15:44 xlap NetworkManager[1177]: <info>  [1681913744.3398] device (wlp1s0): supplicant interface state: associated -> completed
Apr 19 16:15:44 xlap wpa_supplicant[1179]: wlp1s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-76 noise=9999 txrate=26000
Apr 19 16:15:44 xlap NetworkManager[1177]: <info>  [1681913744.3407] device (p2p-dev-wlp1s0): supplicant management interface state: associated -> completed
Apr 19 16:15:49 xlap NetworkManager[1177]: <info>  [1681913749.4690] dhcp4 (wlp1s0): state changed new lease, address=10.13.3.14
Apr 19 16:15:49 xlap avahi-daemon[1119]: Withdrawing address record for 10.13.0.162 on wlp1s0.
Apr 19 16:15:49 xlap avahi-daemon[1119]: Leaving mDNS multicast group on interface wlp1s0.IPv4 with address 10.13.0.162.
Apr 19 16:15:49 xlap avahi-daemon[1119]: Interface wlp1s0.IPv4 no longer relevant for mDNS.
Apr 19 16:15:49 xlap avahi-daemon[1119]: Joining mDNS multicast group on interface wlp1s0.IPv4 with address 10.13.3.14.
Apr 19 16:15:49 xlap avahi-daemon[1119]: New relevant interface wlp1s0.IPv4 for mDNS.
Apr 19 16:15:49 xlap avahi-daemon[1119]: Registering new address record for 10.13.3.14 on wlp1s0.IPv4.
petr
  • 121
  • First, that's the expected ssh response. Look at the network logs with the terminal command: sudo journalctl -b 0 -u NetworkManager. Read man journalctl. – waltinator Apr 19 '23 at 17:13
  • @waltinator Of course I understand that the ssh connection freezes when the laptop obtains a new IP address. My question is why the laptop loozes wifi connection, in logs there is nothing to indicate the reason other than the lines I showed above. – petr Apr 21 '23 at 07:18
  • I also faced the same issue . Earlier i was using ubuntu 20.04 which was working fine and now upgraded to 22.04.02 LTS which keep reconnecting to WiFI and IP getting changed each time . It looks like Ubuntu 22 release the dhcp lease very frequently. @petr let me know if you found the any solution for this. – Vikas Tiwari Jun 21 '23 at 13:15

1 Answers1

1

This is caused by a bug in NetworkManager.

If that bug is triggered by your client switching between 5GHz and 2.4GHz on a single access point, then you can work around this by forcing the use of a particular band: (Use "a" for 5GHz or "bg" for 2.4GHz)

nmcli connection modify <SSID> 802-11-wireless.band a

If that bug is triggered by roaming between access points, then you might be able to work around this by switching from NetworkManager's internal DHCP client to an external DHCP client (using the main/dhcp setting in NetworkManager).

Paul Donohue
  • 1,027
  • 1
  • 6
  • 5