- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to limit network bandwidth on linux
Have you ever shared network bandwidth with multiple devices? If you have ever been in a position where one application consumed all your traffic, then either you are a system admin or just a Linux user, you will need to discover how to control the upload and download speeds for applications to make sure that your bandwidth is not occupied entirely by a single application. This article gives an idea about how to limit network bandwidth on Linux.
Limiting Network Bandwidth
One of the easiest way to control over the network traffic is via command line tool called “trickle“. It can be limit application bandwidth, upload or download speed, or prioritizing daemons (a computer program that runs as a background process). tickle works on the concept based on “Linux Pre-Loader”. It controls the network using send and receive the data through sockets.
To install trickle package, use the following command –
$ sudo apt-get install trickle
The sample output should be like this –
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: trickle 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 34.6 kB of archives. After this operation, 158 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe trickle amd64 1.07-10ubuntu2 [34.6 kB] ........
Usage of Trickle
When using Trickle, choose the appropriate download and upload speeds to limit applications.
For instance, If you are using Firefox as your browser, then limit its downloading capacity to 25 KB/s, and upload badwidth to 15 KB/s. To use trickle in standalone mode, use the following command –
$ trickle -d 25 -u 15 firefox
The above command will open a custom Firefox launcher with network limitations.
Limiting a Network Interface on Linux
Alternatively, control over the network traffic is by enforcing bandwidth limit on per-interface basis. This is most useful way when sharing upstream internet connection with someone else. Using wondershaper tool, you can enforce bandwidth limit on per-interface basis.
To install wondershaper, use the following command –
$ sudo apt-get install wondershaper
The sample output should be like this –
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: wondershaper 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 15.0 kB of archives. After this operation, 77.8 kB of additional disk space will be used. Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty/universe wondershaper all 1.1a-6 [15.0 kB] ....
Usage of wondershaper
Use the following command to control the Ethernet0 (Number-Zero) in Linux system-
$ sudo wondershaper eth0 1000 500
You can remove wondershaper limit using the following command –
$ sudo wondershaper clear eth0
Congratulations! Now, you know “How to limit Network Bandwidth on Linux”. We’ll learn more about these types of commands in our next Linux post. Keep reading!
- Related Articles
- Bandwidth – A Network Bandwidth Utilization Tool for Linux
- Best Tools to Monitor Network Bandwidth on a Linux Server
- Useful Bandwidth Monitoring Tools to Analyze Network Usage in Linux
- How to Improve Linux Network Security
- Monitor network traffic and bandwidth usage in cent os
- What are the cellular network bandwidth capabilities and base station?
- How to Run a Command with Time Limit (Timeout) In Linux
- How to create Android Device Network Listener based on on/off network?
- How to limit maximum items on multiple input ()?
- How to limit the number of results returned from grep in Linux?
- Monitoring Network Usage in Linux
- How to Install Git on Linux
- How to activate virtualenv on Linux?
- How to use tmux on Linux?
- Checking Host’s Network Availability in Linux