Wifi disconnects randomly after several hours (18.04)
This is often the result of the power saving feature in Ubuntu. You can disable this for the WiFi device by editing a file and restarting the network manager.
Here's how:
-
Open Terminal (if it's not already open)
-
Edit the
default-wifi-powersave-on.conf
file:sudo vi /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Note: Feel free to use any text editor of your choice. Be sure to open it with
sudo
, though.You will see the file contents look like this:
[connection] wifi.powersave = 3
-
Replace
3
with2
, then save the file.Definition of Values:
Value What It Means 0
Use the default value 1
Do not change existing setting(s) 2
Disable powersave feature 3
Enable powersave feature -
Restart the network manager:
sudo service network-manager restart
Alternatively, you could restart the entire system.
This should prevent the device from disconnecting from the network when the system believes it is idle.