Method 1: Disable WiFi Power Management
Ubuntu might automatically turn off WiFi to save power. Here’s how to stop that:
- Check Your Network Interface Name: Use
iwconfig
to find your network interface name (it’swlan0for many but can differ). - Turn Off Power Management: Execute
sudo iwconfig wlan0 power off
, replacingwlan0with your actual interface name.
Method 2: Edit NetworkManager Configuration
Prevent automatic disconnections by tweaking NetworkManager:
- Open Configuration File: Run
sudo vi/etc/NetworkManager/NetworkManager.conf. - Add Power Save Setting: Insert the following lines:
[connection]wifi.powersave = 2 - Restart NetworkManager: Apply changes with
sudo systemctl restart NetworkManager.
Encountered “Operation not supported”? If disabling power management directly doesn’t work, try this alternative:
Alternative Method: Use TLP for Advanced Power Management
TLP offers granular control over power settings, including WiFi:
- Install TLP: Update your system and install TLP with
sudo apt update
followed bysudo apt install tlp tlp-rdw. - Start TLP: Activate TLP using
sudo tlp start. - Edit TLP Configuration: Modify
/etc/tlp.conf
to disable WiFi power management. Uncomment (or add) the lines:WIFI_PWR_ON_AC=offWIFI_PWR_ON_BAT=off - Restart TLP: Make your changes effective with
sudo tlp start