Ubuntu 20.04 Wifi Keeps Dropping
I recently moved and set up my system with a new wifi router. Since then, my Ubuntu randomly loses wifi every 5-10 minutes. I have to turn off the wifi setting on my computer and turn it back on to regain internet. Sometimes the wifi will stop and the network history will show full usage and my computer will freeze, requiring a restart. I upgraded to a comcast wifi 6 router. My wifi card is a Intel Corporation Wi-Fi 6 AX200 (rev 1a). Does anyone know how to fix this?
34 Answers
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 getIf you get 00, that is a one-size-maybe-fits-all setting. Find yours here: Then set it temporarily:
sudo iw reg set ISOf course, substitute your country code if not Iceland. Set it permanently:
sudo nano /etc/default/crdaChange the last line to read:
REGDOMAIN=ISProofread carefully, save and close the text editor.
Is there any improvement?
2I 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:
- Turned off autoconnect for the 2.4 GHz secondary connection (name was already different from the main 5.0 GHz connection)
- Changed REGDOMAIN to "US" for American code consistent with chili555's recommendation above (and with my location)
- 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 , 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.
1Check your WiFi MTU, using
ip linkalso 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 1492where "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:ffMy 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).
1I 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
lspcicommand. - To ckeck your kernel enter
uname -r
Hope it help someone with same problem