Limiting the bandwidth is a good idea when you need to download anything without slowing down the other network as the downloads will only consume specific amount of bandwidth. While using Linux, there are different applications that have the ability to limit the bandwidth, the best of them is Wondershaper application. It works for both the server and desktop Linux distributions.
Installing Wondershaper
It is not a built-in application; you need to first install it on your machine. It is available for all the popular Linux Distributions. To install the application through the terminal, you need to first launch the terminal from Ctrl + Alt + T or Ctrl + Shift + T hotkeys. Follow the command-line instructions according to the Linux distribution you are using.
Wondershaper for Ubuntu
For Ubuntu, you can use the Ubuntu Universe repository for the installation of Wondershaper. For some Ubuntu distributions, you need to manually enable the repository.
To enable the Universe Repository for Universe, use the repo command to add universe repository
sudo add-apt-repository universe
Run the update command to use the universe repository and deploy the changes.
sudo apt update
Now install the Wondershaper using the apt install command.
sudo apt install wondershaper
Wondershaper for Debian
Wondershaper for Debian comes in Debian Main repository. All you need to use apt-get command to install the application. It requires no additional configurations.
sudo apt-get install wondershaper
Wondershaper for Arch Linux
You need to build it through the AUR as Wondershaper is not available in the Archi Linux repositories. To build the app using AUR, install the base-devel and Git packages with Pacman manager.
sudo pacman -S git base-devel
Now grab the AUR package with Git tool.
git clone https://github.com/magnific0/wondershaper
Move the Wondershaper to the sources folder on Arch Linux.
cd wondershaper
makepkg -sri
Wondershaper for Fedora
The primary Fedora repository contains Wondershaper and you can easily install it through the dnf package manager command.
sudo dnf install wondershaper -y
Wondershaper for OpenSUSE
OpenSUSE provides Wondershaper from Leap 15 to 42.3 and Tumbleweed, you need to use Zypper command to get it from OSS All repository.
sudo zypper install wondershaper
Wondershaper for Generic Linux
You can use the source code from the Github and make it ready for installation using the git command.
git clone https://github.com/magnific0/wondershaper.git
cd wondershaper
Now Run using:
./wondershaper
Setting up Wondershaper
After installing Wondershaper, you need to use Systemd init system to load the app and boot-up.
For Ubuntu/Debian
To install the application on Ubuntu or Debian Linux, you will not need Systemd as because of Apt that can automatically set up all the things.
For Other Linux Distributions
In order to use Wondershaper on Fedora, Arch, OpenSUSE, systememd can manually set up things.
sudo systemctl enable wondershaper.service
sudo systemctl start wondershaper.service
For disabling Wondeshaper, you need to also use the Systemd.
sudo systemctl disable wondershaper.service
and restart it using
sudo systemctl stop wondershaper.service
Managing the bandwidth with Wondershaper
To manage the bandwidth with Wondershaper, you need to start by finding the IP address of the network card using ip addr show command.
ip addr show
Use the IP address in the Wondershaper and follow the syntax. Provide download limit after d and upload limit after c. adapter is the IP address and the mb stands for megabytes.
sudo wondershaper -a adapter -d mb -u mb
To stop Wondershaper settings, you need to stop limiting the bandwidth using c switch that represents clear.