wondershaper
is a great script except it seems too complicated to understand and use (i.e. modify).
This script uses tc
with HTB (Hierarchy Token Bucket) where configurations are largely simplified.
Checkout the usages by running the program without any argument.
For more information, checkout the guide 9.5.5. Hierarchical Token Bucket from the Linux Advanced Routing & Traffic Control HOWTO
Note: the sample script shapes ip traffic with destination port 8888
, 9999
and 5201
.
You should change it to the service port for your own application. In the example section,
we are using speedtest
which runs over port 80. Do that or you won't see changes.
wget -O shaper <url>
chmod +x shaper
./shaper start eth0 100kbit
./shaper show eth0
./shaper clear eth0
You can use speedtest-cli
wget -O speedtest https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest
speedtest
Just to prevent confusion, tc uses the following rules for bandwith specification:
mbps = 1024 kbps = 1024 * 1024 bps => byte/s
mbit = 1024 kbit => kilo bit/s.
mb = 1024 kb = 1024 * 1024 b => byte
mbit = 1024 kbit => kilo bit.
Internally, the number is stored in bps and b.
But when tc prints the rate, it uses following :
1Mbit = 1024 Kbit = 1024 * 1024 bps => byte/s
Hi
Is possible to allocate bandwidth port wise TCP /UDP
TCP -Port
80= 1Mbit,
21= 2 Mbit
8080= 5Mbit
UDP-PORT
5001=1Mbit
5002=2Mbit
5003=3Mbit
5004=4Mbit
5005=5Mbit
if it is possible could you please guide me thanks
Manickam