The Dropped Connection
Ubuntu is configured out of the box to prioritize battery life on laptops. One of the ways it achieves this is through aggressive power management of the networking hardware. If your computer is running on battery power and the system detects a period of network inactivity (or if you close the lid), Ubuntu may automatically suspend the Wi-Fi adapter to save electricity. While this extends your battery life, it frequently causes the Wi-Fi connection to drop entirely. Worse, some network cards struggle to wake up properly from this suspended state, requiring you to manually restart the Network Manager or reboot the computer just to get back online.
Disabling Wi-Fi Power Management
To ensure a stable, uninterrupted internet connection and stop Ubuntu from automatically suspending Wi-Fi to save power, you must disable the specific power management protocol in the system configuration files.
This cannot be toggled in the graphical settings menu. Open your terminal by pressing Ctrl+Alt+T. You need to edit the default Network Manager configuration file. Type exactly: sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and press Enter (provide your password). You will see a very short file with a line that reads wifi.powersave = 3. The number 3 indicates that power saving is enabled. Use your arrow keys to navigate to the 3, delete it, and replace it with a 2 (so the line reads wifi.powersave = 2). Press Ctrl+O then Enter to save the file, and Ctrl+X to exit the nano editor. Finally, restart the network service by typing: sudo systemctl restart NetworkManager. Your Wi-Fi adapter will now remain fully powered at all times.