Introduction
re you experiencing slow Wi-Fi speeds on your Ubuntu system? Don’t worry, we’ve got you covered! In this article, we will explore simple and effective techniques to boost your Wi-Fi performance on Ubuntu. By implementing these tips, you can enhance your browsing, streaming, and downloading experience.
1. Maximize Wireless Adapter Power
Although this technique may no longer be necessary, some users still find it helpful. In older versions of Ubuntu, the power management system of the Linux Kernel sometimes reduced the power sent to the wireless adapter, resulting in inconsistent performance. To check if your system is affected and potentially resolve the issue, follow these steps:
- Open a terminal and run the command:
sudo iwconfig
- Identify the name of your wireless device (e.g.,
wlan0
) - Disable power management for the wireless adapter using the command
sudo iwconfig wlan0 power off
Verify the changes by running iwconfig again and ensuring that “Power Management” is set to “off”
$ iwconfig
lo no wireless extensions.
wlan0 IEEE 802.11 ESSID:"TestingWifi"
Mode:Managed Frequency:2.4 GHz Access Point: 22:XX:XX:XX:XX:XX
Bit Rate=36 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=58/70 Signal level=-52 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:1 Invalid misc:0 Missed beacon:0
2. Disable Wi-Fi Power Saving
Wi-Fi power saving is a feature that can reduce bandwidth from 100Mbps to 20Mbps. To disable Wi-Fi power saving in Ubuntu, follow these steps:
- Open the
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
# Ubuntu
sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
# Arch Linux
sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf
- Set the value of wifi.powersave to 2
# File to be place under /etc/NetworkManager/conf.d
# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).
#ubuntu
wifi.powersave = 2
#arch linux
[connection]
wifi.powersave = 2
- Here is the possible value for
wifi.powersave
:
0: use the default value
1: don’t touch existing setting
2: disable powersave
3: enable powersave
- Save the changes and exit the editor
- Restart the
NetworkManager
service
sudo service NetworkManager restart
# Or
sudo systemctl restart NetworkManager
3. Disable IPv6 Support
Disabling IPv6 support can sometimes improve Wi-Fi speed, especially if you don’t require IPv6. To temporarily disable IPv6 support, follow these steps
- Open a terminal and run the following commands
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
- If the temporary disablement works, make the changes permanent by running the following commands
sudo su
echo "#disable ipv6" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf
- Restart your computer for the changes to take effect
4. Switch to the 5GHz Band
If your Wi-Fi is currently using the 2.4GHz band, switching to the 5GHz band can potentially improve performance. Here’s how you can force your Wi-Fi connection to use the 5GHz band:
- Check the frequency band currently in use
sudo iwconfig
wlan0 IEEE 802.11 ESSID:"TestingWifi"
Mode:Managed Frequency:2.4 GHz Access Point: 22:XX:XX:XX:XX:XX
Bit Rate=36 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=58/70 Signal level=-52 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:1 Invalid misc:0 Missed beacon:0
- Identify your network’s system-connections file
(e.g.,
/etc/NetworkManager/system-connections/TestingWifi.nmconnection
)
- Open file in editor mode
sudo vim /etc/NetworkManager/system-connections/TestingWifi.nmconnection
- Under the
[wifi]
section, add/edit theband
field as follows
band=a
band=bg
// This will set the network to use the 5GHz band only. If you want to use the 2.4 GHz band only then set the band to bg
- Save the changes and exit the editor
- Restart the
NetworkManager
service
sudo service NetworkManager restart
# or
sudo systemctl restart NetworkManager
Setting up DNS resolv
change dns server to using google dns
# sudo vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
Run the following command to lock the /etc/resolv.conf
configuration file to prevent the /etc/resolv.conf
file from being dynamically updated due to network reboots or operating system reboots
# lock file
chattr +i /etc/resolv.conf
# To modify the /etc/resolv.conf
# for unlock the file
chattr -i /etc/resolv.conf
restart the systemd-resolved service
systemctl restart systemd-resolved
Conclusion
By following these techniques, you can optimize your Wi-Fi performance on Ubuntu and enjoy faster speeds and improved reliability. Experiment with these tips and find the configuration that works best for your system. Happy browsing!