Linux – Limit Network Bandwidth Using WonderShaper Tool
Last Updated :
11 Feb, 2021
So here in this article, we are going to see how to limit a network bandwidth in Linux using WonderShaper. It is a tool which is a small bash script that enables us to limit the network bandwidth in Linux. It works as the tc command-line program as the backend for configuring traffic control in systems.
Here this tool allows us to set the maximum download rate and maximum upload rate. Even we can clear the limits that we have for downloading and uploading and even display the current status of the interface from the command line.
Installation:
Step 1: Let’s install WonderShaper in Linux:
sudo apt install wondershaper

Now we can install WonderShaper with a different method. By using this method we can have the latest updates of WonderShaper.
So before proceeding to this we need to have git (Git is a distributed version control system for tracking changes in any set of files) installed.
sudo apt install git
Step 2: First Navigate to the bin directory using the cd command in terminal
cd /bin
Step 3: Next using the below command download the latest version
git clone https://github.com/magnific0/wondershaper.git

Step 4: Now we want to WonderShaper directory and install it using the below one.
cd wondershaper
sudo make install

So now installation and setup is done for WonderShapper
Enable and start the service:
Now we will Enable and start the WonderShaper service. Next, we have to enable the service to allow it to start every time we automatically when the system boots. WonderShaper can run as a service like the other is Linux systems.
Now we have to enable and start the service in our system:
sudo systemctl enable wondershaper.service

sudo systemctl start wondershaper.service

Even we can verify if the WonderShaper service is active. Using the following below command
sudo systemctl status wondershaper.service

If we want to stop the service we can use the below command
sudo systemctl stop wondershaper.service

We can even restart the service if we have any problem with the service using the below command:
sudo systemctl restart wondershaper.service
Now we can see how to use the WonderShapper tool:
Now we want to find the interface for which we have to limit the bandwidth. We can find the respective interface name using the following commands:
ifconfig
Now after knowing the interface name on which we want to limit the bandwidth using the below Command:
Syntax: sudo wondershaper -a <interface> -d<rate> -u <rate>
Where:
- -a: defines interface name
- -d: defines download rate in kbps
- -u: defines upload rate in kbps
So for example,
sudo wondershaper -a eth0 -d 2048 -u 512

Above, set the download rate to 2048 kbps and the upload rate to 512 kbps.
Even we can set both downloads rate and upload rate separately.
Like: sudo wondershaper -a eth0 -d 4096

The above one will set the download rate to 4096 kbps
So now to clear or remove the bandwidth limits of an interface we can use the below command.
sudo wondershaper -c -a eth0

Similar Reads
What is Bandwidth and Protocol in Networking?
Downloading is a phenomenon in which we receive data from the internet on your system. For example- music, video, audio, etc., and Bandwidth is measured as the amount of data that can be transferred from one point to another within a network in a specific amount of time. A protocol is a set of rules
6 min read
Linux iftop - Listen Network Traffic and Bandwidth
The iftop listens to network traffic on a specified network interface. The iftop is a perfect tool for remote Linux server over a ssh based session.iftop displays the bandwidth usage by a pair of hosts in the form of a table. To run this tool we must have superuser (root)permissions. Installation: I
3 min read
DDOS A WiFi Network With MDK3 Tool In Kali Linux
Imagine you're a network security enthusiast wanting to understand how malicious actors could disrupt WiFi networks. In this article, we'll explore using MDK3, a powerful tool in Kali Linux, to perform a Distributed Denial of Service (DDOS) attack on WiFi networks. Using DDOS - A WiFi Network With M
6 min read
How to Monitor Network Traffic Using Wireshark in Windows?
Monitoring network traffic is critical for diagnosing network issues, analyzing performance, and enhancing security. Wireshark is an important and generally- used network protocol analyzer that allows you to capture and inspect packets in real- time on your Windows system. In this article, we will w
5 min read
How to disable ping to a website using Linux?
In this article we are going to create a customized network setup, to restrict accessing specific sites. Suppose we want to access Google and don't want to access Facebook, for this we need to create a customized network setup by configuring some routing rules for our system router. So let's come to
2 min read
How to Install and Use Wireshark on Ubuntu Linux?
Wireshark is an open-source network protocol analyzer that helps us to see what is happening inside a network when we try to communicate with other networks. Currently, Wireshark is the most famous application to analyze networks. As the most popular network analyzer tool, Wireshark provides an in-d
3 min read
XERXES â Penetration Testing Tool using Kali Linux
XERXES is a free and Open source tool available on GitHub. You can install and download the tool free of cost. A denial of service attack can be performed by using this tool. Xerxes is written in C. The framework works by maintaining a full TCP connection. After making full TCP Connection it only re
1 min read
Iperf Command to Test Speed, Performance and Bandwidth of Network in Linux
There is a great degree of flex in how the packets are delivered and overall bit rate and packet payload size can be controlled. iperf is a tool that is used to perform network performance measurement and tuning. iperf is an open-source software which is written in C language. Jperf is a GUI version
2 min read
How to Install and Use vnstat Network Traffic Monitoring Tool in Linux?
VnStat is a network utility that uses a command-line interface designed for Linux. Logs of the selected interface(s) of hourly, daily, and monthly network traffic are kept, although it is not a packet sniffer. The network interface statistics that are provided by the kernel as the information source
2 min read
How to Install and Use bmon Real Time Bandwidth Monitor in Linux?
Bmon Stands is an open source tool for the bandwidth monitoring tool. bmon is a powerful CLI based network bandwidth monitoring and debugging tool for Unix / Linux systems to capture networking related statistics & present them visually on the command line in a human-friendly way. It captures th
4 min read