- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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!
- Monitor network traffic and bandwidth usage in cent os
- What are the cellular network bandwidth capabilities and base station?
- How to create Android Device Network Listener based on on/off network?
- How to Run a Command with Time Limit (Timeout) In Linux
- How to Install Git on Linux
- How to activate virtualenv on Linux?
- How to limit the number of results returned from grep in Linux?
- How to Install C++ Compiler on Linux?
- How to configuring Java Environment on Linux?
- How to Join Several Partitions on Linux
- How to Install Atom 1.6.0 on Linux
- How to free Inode usage on Linux?
- How to use chmod recursively on Linux?
- How to Migrate MySQL to MariaDB on Linux?
- Signals and Systems – System Bandwidth Vs. Signal Bandwidth