114

I installed Ubuntu 18.04 LTS in this week and now I have a problem with wifi connection. The WiFi connection auto disconnected every 5 - 10 minutes but wifi signal is still fine.
I did a search, found some answers for older versions of Ubuntu and tried it but the problem was not resolved.
Here is my wireless adapter information:

description: Wireless interface
       product: QCA9565 / AR9565 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlp2s0
       version: 01
       serial: a4:db:30:03:32:8c
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.15.0-20-generic firmware=N/A ip=10.0.138.105 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:18 memory:f0600000-f067ffff memory:f0680000-f068ffff
Cảnh Đinh Văn
  • 1,245
  • 2
  • 8
  • 7

8 Answers8

84

Try disabling wifi power management by opening /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and changing

wifi.powersave = 3

to

wifi.powersave = 2

Do not set it to 0, which is the default value. From nm-setting-wireless.h:

/**
 * NMSettingWirelessPowersave:
 * @NM_SETTING_WIRELESS_POWERSAVE_DEFAULT: use the default value
 * @NM_SETTING_WIRELESS_POWERSAVE_IGNORE: don't touch existing setting
 * @NM_SETTING_WIRELESS_POWERSAVE_DISABLE: disable powersave
 * @NM_SETTING_WIRELESS_POWERSAVE_ENABLE: enable powersave
 *
 * These flags indicate whether wireless powersave must be enabled.
 **/
typedef enum {
    NM_SETTING_WIRELESS_POWERSAVE_DEFAULT       = 0,
    NM_SETTING_WIRELESS_POWERSAVE_IGNORE        = 1,
    NM_SETTING_WIRELESS_POWERSAVE_DISABLE       = 2,
    NM_SETTING_WIRELESS_POWERSAVE_ENABLE        = 3,
    _NM_SETTING_WIRELESS_POWERSAVE_NUM, /*< skip >*/
    NM_SETTING_WIRELESS_POWERSAVE_LAST          =  _NM_SETTING_WIRELESS_POWERSAVE_NUM - 1, /*< skip >*/
} NMSettingWirelessPowersave;
Sahin
  • 250
qwr
  • 2,802
  • 7
    I had the same issue with a Realtek WiFi AC1200 USB and the internal that is. Broad... . Tried the power configuration and the IPv6 disabled. None worked. Finally setting an static IPv4 to the laptop works. Hope this option help someone. – Sposmen Oct 13 '18 at 11:43
  • @Sposmen I suggest writing this as an answer so it is more visible. – qwr Oct 13 '18 at 20:49
  • 1
    @Sposmen I've also tried all that and yet the connection kept dropping every 10m or so. Which ubuntu you did this successfully? Was it 18.04? As qwr said,I also suggest to add this as an answer. – Lucas Vasconcellos Czepaniki Nov 27 '18 at 22:33
  • 1
    This solved my problem a few months back with Ubuntu v16.04. However, the problem has returned with v18.04.1. – josephwb Nov 29 '18 at 10:53
  • 13
    Does not fix the issue for me on Ubuntu 18.04.2 LTS, unfortunately. – Cleb May 25 '19 at 11:33
  • 3
    Disabling the power saving worked for me. Damn if it has a problem then maybe they should not enable the power saving by default. – vishal Aug 14 '20 at 11:35
  • Does the setting take effect immediately or is a reboot required? – tresf Oct 26 '20 at 05:22
  • @tresf I think you need to restart service network-manager. – qwr Oct 26 '20 at 06:22
  • Thanks, with lack of commands to do so, I rebooted and it seemed to help the underlying issue. I also disabled IPv6 per this answer, but I'm not sure if it had an effect: https://askubuntu.com/a/1180403/412004. My symptoms were a ping that gradually rose from 3ms to 200ms (Dell XPS, Ubuntu 18.04) and the solutions seemed to have fixed it. :) – tresf Oct 26 '20 at 06:30
  • It worked for me on Ubuntu 20.04. But I actually didn't understand why did it happen and why it was solved changing this configuration. – João May 23 '21 at 14:34
  • It worked for me also (20.04) – Jam May 24 '21 at 17:10
  • Thanks! I had a similar issue with an intel network controller (Intel Corporation Comet Lake PCH CNVi WiFi) which was fixed with your suggestion – Filipe Felisbino Oct 24 '21 at 02:57
  • This worked for me in 20.04 as well. – seanbreeden Feb 12 '23 at 23:48
15

You could try to turn OFF IPV6 in the settings for your connection between your computer and the router. Sometimes there is a problem in Ubuntu, with IPV6 - and most old routers still use IPV4. This worked for me on my old Pocket wifi(the new one don't have problem). Since you have not specified excactly which version of 18.04 you are using I can't guide you more.

I have Xubuntu 16.04, and I would go to network connection in the notification, then open Edit connections, find the connection to the router and edit it. Set IPV6 to Ignore. After this it never dropped the connection.

  • Disabling ipv6 did the job for me. Thanks. – AlikElzin-kilaka Jul 13 '19 at 23:36
  • I ran into this by accident when I discovered that my ping to google.com (an IPv6 address) was failing but existing ipv4 connections were still working. DNS was using IPv6 so all new connections would fail. The really WEIRD thing is, earlier today it got into a state where even a power off and back on didn't fix it, and I had to reset the ROUTER even though several other devices could still see the internet just fine. – Michael May 19 '20 at 04:44
9

This is what stopped my wifi to get unstable, disconnecting all the time, although my wifi is Centrino (not Atheros): disabling IPV6.

Add the following lines to the file /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Then run to reload the settings:

sudo sysctl -p    
desgua
  • 32,917
7

I was having the same issue with bionic. First i thought it was related with Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter, but even after updating it the signal continued to fluctuate.

It appears to be related to gnome's network manager. After switching to WICD, the wi fi hasn't been unstable anymore (that was almost 4 months ago). [EDIT: Still no issues as of today 05/28/2019] Here are a few steps to apply this fix:

Open up a Terminal and execute the following commands:

First, install WICD:

 sudo apt install wicd-gtk

Next, we uninstall NetworkManager:

sudo apt remove network-manager-gnome network-manager

After everything is confirmed to be working (best to check this after rebooting), you can remove config files for NetworkManager:

sudo dpkg --purge network-manager-gnome network-manager

(source https://help.ubuntu.com/community/WICD )

  • 1
    It seems good, but it does not has any shortcut or icon on the top menu! – SaidbakR Oct 28 '18 at 16:49
  • 1
    Yeah, it doesn't quite switch network manager's icon/reference and it also doesn't create a new one for it. But at least you get a stable connection, and you can access WICD through gnome overview/applications almost as quickly. – Lucas Vasconcellos Czepaniki Nov 03 '18 at 04:18
  • Great solution, worked for me. – ivan marchenko May 14 '19 at 11:34
  • 1
    Working on Ubuntu 18.04.2 LTS, this has made it even worse, unfortunately. After calling sudo apt remove network-manager-gnome network-manager, WICD did not detect a single Wifi network anymore; also the settings button was gone. I could recover the settings part using sudo apt install gnome-control-center and then also reinstalled the network-manager, but now also this one does not detect networks anymore. So, make sure you also have a lan connection, otherwise you'll be in trouble :) – Cleb May 25 '19 at 14:55
  • After removing network-manager the wifi settings section on ubuntu settings doesn't work, because it uses network-manager for it so it's to be expected. As for wicd, you can check if the network interface is configured correctly (for bionic it should be wlp3s0) or if the issue is related to the WPA Supplicant (In a certain occasion I had an issue like that, and I managed to fix it by selecting nl80211 as the supplicant -- but after an update i switched back to wext and the issue seemed to be resolved). – Lucas Vasconcellos Czepaniki May 28 '19 at 08:10
  • This works for me, on linux-5.4 kernel, latest firmware for my wifi card. Wicd has a tray mode, which is automatically included in the startup applications +1! – thedoctar Dec 02 '19 at 23:52
  • Follow the instructions here to for disabling network-manager safely. Then start wicd by running wicd-client. See also here. Note that I had trouble with the notification tray icon running gnome 3.26. (wicd is too old and unmaintained.) Turned out installing TopIcon Plus solved the problem. – Tim Mak Aug 24 '20 at 07:23
6

In furtherance to DESGUA's answer, I changed /etc/dhcp/dhclient.conf. More specifically, I deleted line 18:

dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,

I eventually disconnected wifi and reconnected.

My Lenovo T460p laptop running Ubuntu 18.04 no longer randomly disconnects from wifi. It seems (the implementation of) IPv6 is the culprit.

dzmanto
  • 371
  • 1
    This together with DESGUA's answer worked for me. Just setting wifi.powersave = 2 didn't have any effect. – Leo Sep 14 '20 at 07:49
3

In my case changing the router frequency from 5 GHz to 2.4 GHz solved the problem to a great extent.

Pankaj Joshi
  • 131
  • 3
  • how to change frequency? any reason why it works? – roottraveller Feb 11 '19 at 04:34
  • You can change the frequency on the web page of router. You can find it written on the router or in the docs that come with router. I do not know the reason why it woked on my machine :( – Pankaj Joshi Feb 11 '19 at 05:34
  • Most routers today offer a 2.4 interface along side the 5 GHz, so technically you don't actually need to alter the 5G interface. – Lucas Vasconcellos Czepaniki May 15 '19 at 14:21
  • This "can" work because 2.4GHz passes through walls/barriers better than 5GHz because those numbers represent oscillations per second. Think of it as 2.4GHz has about half of the wiggly-ness (waves) in travelling across any medium as 5GHz, which translates to less opportunities for obstruction/deflection, linearly-speaking. But 2.4GHz is often much more crowded, with there only being three standard, friendlier bands available, 1, 6 and 11. Advantages of 5GHz, though, are higher capacity data rates (therefore less transmit time/interference) by virtue of the extra wiggly-ness, and many bands. – Hypocritus Mar 17 '20 at 22:33
  • My router has 'SmartSteering' so I set my laptop's MAC to only use 2.4Ghz. My wifi strength then jumped from 1/3 to 2/3. I previously had this problem with another laptop too (Linux). Thx. – Peter L Mar 28 '20 at 17:41
  • This is what I wound up having to do - every time my internet would seem to drop out I would switch back and forth between 5Ghz and 2.4Ghz. Although, having to keep switching back and forth is a PAIN and it appears disabling ipv6 may fix it. – Michael May 19 '20 at 04:46
3

My setup might be a bit different, but maybe my answer helps too...

My setup is as follows:

laptop <-> wifi (bridge mode) <-> router <-> internet
  • Laptop is Ubuntu 18.04.2.
  • WiFi bridge is a TP-Link TL-WR940N.
  • Router is an Arris 703A.

I had the same issue of connection dropping from time to time. I believe it was happening because all services are running in the Arris router and the connection between the TP-Link and the Arris suffer with oscillations, so everything connected to the TP-Link "thinks" there is no network connection, so the connection is dropped.

The only thing that worked for me to keep the connection more stable was setting up static IP address, gateway and DNS servers, instead of using DHCP.

I still get oscillations, but at least wifi doesn't drop; just takes a bit longer sometimes to complete the requests.

Well, that's a very simple answer, but hope it can help someone out there.

3

I had the same issue for a long time (Ubuntu 18.04, 19.04 and also 20.04) and none of the solutions from above worked properly for me; the answer here worked ok, but running on 2.4GHz instead of 5 GHz gave performance issues.

What seems to have worked is to switch off the automatic choice of the channel, but set it to manual for the 2.4 GHz option in my router settings (and use auto for the 5GHz option):

enter image description here

I did this a couple of days ago and have not had any issues since then: 5GHz is used for all my devices, performance is excellent and I have not seen any drops anymore (hopefully it remains like this after posting this answer here ;-) ).

Cleb
  • 293
  • 4
  • 13
  • Thanks. I have the same router and indeed manual channel setting helps, although does not fix the problem completely - disconnects are now more rare and shorter, but still exist. – katafrakt Jul 30 '20 at 22:52
  • Turning off the 802.11b/g/n (default) mode in my router and switching 802.11b/g did the trick for me. – SanD Dec 13 '20 at 15:02
  • Can you show me where that option is available in WiFi settings? Some brief steps? Can't figure out from your answer or the reference. – ARK May 21 '21 at 14:36