16

My wifi is constantly dropping out on both my laptop and desktop. This has occured on both my home wifi and when setting up my phone as a hotspot. This 'dropout' still shows the wifi as connected, however any network traffic (such as pinging a known ip) fails (EDIT: This was wrong, couldn't replicate failure to ping 8.8.8.8. Solution was DNS issue). This seems to happen after using the internet for anywhere from 2-30 minutes. The only solution to fix is a reboot, or restarting the network manager as such:

sudo systemctl restart network-manager

I initially thought it was a problem with my wireless card in my laptop (Dell XPS 13 9350), however switching the issue persisted when switching to an intel wifi card and back again to the stock broadcom based card. The issue is also present on my desktop although appears to happen less frequently (purely observational). Also, the frequency of dropouts seems to have increased since upgrading to 18.04 (again, purely observational and may not be so).

I do not know much about debugging this issue, however looking at the wifi logs with sudo journalctl -fu NetworkManager yields the following entry whenever there is a dropout:

May 06 20:17:48 my-laptop NetworkManager[13190]: <info> [1525601868.0127] connectivity: (wlp58s0) timed out

Any suggestions on how to debug this drop in network access?

4
  • Possible duplicate? askubuntu.com/questions/1030653/… Jul 13, 2019 at 22:34
  • 1
    Look at the logs! sudo journalctl -b 0 -u NetworkManager. Read man journalctl.
    – waltinator
    Jul 23, 2021 at 22:30
  • I've tried this, but I do not know what I am looking for. Jul 23, 2021 at 22:41
  • Follow the progress of Network Manager, step by step, and observe what it says it is doing. Carefully read each line. Understand the message - Is informative, does it describe unusual behavior, does the date/time correspond to an "event"?
    – waltinator
    Jul 23, 2021 at 23:30

9 Answers 9

17

Try disabling powersave for Wi-Fi. In /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf set:

wifi.powersave = 2

To take effect, just run:

sudo systemctl restart NetworkManager
2
10

Take a look at this thread WiFi randomly disconnected on Ubuntu 18.04 LTS you may help you. If it doesn’t try using an Ethernet cable and seeing if it works. If your wifi is 5ghz and going through walls or other insulators it will be weaker than 2.4ghz would because it has smaller wave lengths. But this may not help you so if these fail wait for someone else to reply.

2
  • 1
    Thank you very much William Mac. Turns out it was a DNS issue, as I was unable to replicate failure to ping. Tried the steps outlined (editing /etc/resolve.conf) and it has been stable for a few hours now. Thanks so much, as this issue has been driving me mad recently.
    – Lobe
    May 7, 2018 at 0:35
  • Please provide context for the link, per these guidelines: meta.stackexchange.com/help/how-to-answer Jul 13, 2019 at 22:30
7

Your wireless may be dropping because of power management; that is, the feature where the card partially powers down to save battery power during periods of inactivity and then, ideally, powers back up seamlessly when activity resumes. Let's disable power saving to see if it helps. From the terminal:

sudo sed -i 's/3/2/' /etc/NetworkManager/conf.d/*

Your wireless may be dropping because the channel to which it was connected has suddenly changed.

Please check the settings in the router. WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, you may have better connectivity with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds. I recommend a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred.

Your wireless may be dropping because there are two wireless access points with the same name and password. This is typical when you have a 2.4 gHz segment and a 5 gHz segment of the same router. Your wireless may be roaming, looking for a better connection. If this is the case, I suggest that you rename the access points; something like myrouter2.4 and myrouter5.

After making these changes, reboot the router.

Next, I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get

If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:

sudo iw reg set IS

Of course, substitute your country code if not Iceland. Set it permanently:

sudo nano /etc/default/crda

Change the last line to read:

REGDOMAIN=IS

Proofread carefully, save and close the text editor.

Is there any improvement?

2
  • I've tried that, my REGDOMAIN has been equal to =US for two days. Still sporadic disconnections. Jul 24, 2021 at 0:37
  • My internet was constantly dropping. I had the same internet connection name for both frequencies. I've fixed the issue by giving a different name for each 2.4 and 5 gHz connections. Dec 24, 2021 at 11:23
1

I was having this problem and I think (no drops this morning in moderately heavy use over three hours) I have resolved it. After reviewing this and many other threads, I found that most of my settings were already correct, but made the following changes:

  1. Turned off autoconnect for the 2.4 GHz secondary connection (name was already different from the main 5.0 GHz connection)
  2. Changed REGDOMAIN to "US" for American code consistent with chili555's recommendation above (and with my location)
  3. Changed my modem/router's setting to 1492 (it had been set to 0, but with comment that 0 defaults to 1500), consistent with waltinator's comment above.

While I think 1. and 2. were mainly tidying that probably doesn't really affect things, I think 3. is probably what fixed things. This is based in broad degree on my experience that the Linux community is very good about tracking down and fixing problems with Linux, but a modem setting problem isn't really a problem with Linux.

For my modem/router -- a Motorola MG7540 -- this required going in a browser to the modem control page at http://192.168.0.1/, logging in, and opening the Advanced>Basic Router>Setup page. At the very bottom of that page under "WAN" is a box where "IPv4 MTU Size" can be set. As noted, I changed that from the default of 0 that really means 1500 to 1492, and the problem seems to be fixed.

Thanks to chili555 and waltinator and everyone else who commented on this issue here and elsewhere.

1
  • Thank you. I think that 1 was my issue with my Archer C7 router using SmartConnect as @Diogo Gomes mentioned.
    – imbr
    May 9, 2022 at 12:16
0

Your not going to believe this but, my WIFI disconnected all the time. I went to setting to change the screen time out. I changed that to NEVER. Not knowing what I was doing, I changed the Turn off WIFI to save power to OFF. Of course I lost the WIFI. I also turned Blutooth OFF. After I figured out the WIFI was disconnected, I went back to Settings and turn the Turn off WIFI to save power back to ON. Since that time I have been on the Internet for over 4 hours with no disconnection. Could the fix be that simple?

0

Check your WiFi MTU, using

ip link

also notice your WiFi interface's name.

The MTU (Maximum Transmission Unit) is the size of the largest packet that can be sent in a single network transmission. If a packet exceeds the MTU of a link, the data must be split into multiple packets (fragmented). These multiple packets must be sent over the link, received, acknowledged, and reassembled at the far end. If your link is misconfigured, and you have to fragment every packet you send, your actual data transfer rate drops.

Ethernet (wired) networks use an MTU of 1500 bytes.

Due to additional per packet overhead for WiFi (8 bytes PPPoE header), WiFi uses an MTU of 1492.

Your MTU should be set by your DHCP server, check your router's config.

You can set your own MTU (setting does not persist over restarts) with

sudo ip link set dev name mtu 1492

where "name" is the interface name from above.

Here's an example:

walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff
walt@squid:~(0)$   sudo ip link set dev wlxf46d04b1790f mtu 1492
[sudo] password for walt: 
walt@squid:~(0)$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp63s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:24:21:7f:e5:1c brd ff:ff:ff:ff:ff:ff
3: wlxf46d04b1790f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1492 qdisc mq state UP mode DORMANT group default qlen 1000
    link/ether f4:6d:04:b1:79:0f brd ff:ff:ff:ff:ff:ff

My WiFi "interface name" is "wlxf46d04b1790f".

NOTE: packet fragmentation is not logged, as it's a "feature" of the Data Link layer (layer 2 in the OSI model).

1
  • Ok, I set my WiFi interface to 1492 MTU. It was at 1500. Do I have to do this everytime I turn my computer on? Jul 23, 2021 at 23:43
0

I have same problem, my wifi disconnect every 20-40sec after update to Ubuntu 22.04.

I check dmesg -w command and find error msg so it say me that problem in programming lvl, but not in network that i think first. It was repeated error about disconnect after 10ms.

I find this bug in kernel so if you have Network controller: Qualcomm Atheros AR93xx AR94xx try to update kernel to 5.17.5 or newer and it gone.

  • To check your network controller enter lspci command.
  • To ckeck your kernel enter uname -r

Hope it help someone with same problem

0

Probably not a common occurrence, but did not see this as an answer anywhere else.

It is possible that a "Route" got added to the IPv4 or IPv6 connection/setting. I used a program that added a route to my IPv4 and the wifi would connect, give me 30 seconds of internet, then disconnect and I had to manually reconnect.

  • Under Network Settings, click on your named wifi (connection name) and then click on the little settings icon at the bottom
  • Look at the resulting tabs, should be a IPv4 and IPv6 tab, click on each and look at "Routes" near the bottom (click on it if it is a button)
  • If there is a "Route" there, try deleting that Route for both the IPs... obviously if you set this up intentionally you should record these values so that you can re-add them later if needed.
0

Hi I was facing the same problem, and tried all the solutions.

I'm using a WDS bridge, and my wi-fi is satble with the original router, it's just disconnect with the repeater router.

I updated the router firmware and the problem was solved, i kept the solution about changing the power saving configuration

Not the answer you're looking for? Browse other questions tagged or ask your own question.