this gist will help you limit your network bandwidth using wondershaper tool !!
there are a lot of reasons you would do that, it is very useful when you are trying to :
- control your internet quota or
- throttle internet connection to know how certain app or service work on slow connections .
- have more than one wifi adapter and need to control the speed each one connects to internet
- any other reason IDK about 🤷🏻♂ !
so here we go
sudo apt install wondershaper [On Debian/Ubuntu]
sudo yum install wondershaper [On CentOS/RHEL]
sudo dnf install wondershaper [On Fedora 22+]
sudo pacman -S wondershaper [ on Archlinux and based systems]
you need to find your wifi card id that you will limit by running this command
ifconfig
output will be like
br-85a34b55f6de: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
... other stuff
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
... other stuff
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
... other stuff
so here my wifi adapter name is 'wlp2s0' and lo is wired ethernet , you should know the one you need by other info like the ip or data usage , but if you have one wifi adapter it is usually wlp2s0.
sudo wondershaper -a wlp2s0 -d 4000 -u 1024
with the -d argument represents download speed in kb and -u represents upload speed in kb
sudo wondershaper -c -a wlp2s0
you also need to run this command before applying any new limit on the same adapter
you can find them in this gist 👇🏻
Really useful, thanks