magnific0 / wondershaper

Command-line utility for limiting an adapter's bandwidth
GNU General Public License v2.0
1.71k stars 256 forks source link

Only one direction limit? #84

Closed sergeolkhovik closed 2 years ago

sergeolkhovik commented 2 years ago

Hi! Is it possible to limit only one direction, i.e. only ingress or egress? It'd really useful in my cases. I tried to set something like 100000, but it didn't work correctly. Thanks!

ghost commented 2 years ago
wondershaper -a eth1 -u 4096  # only limit upload
wondershaper -a eth1 -d 4096  # only limit download

OR

wondershaper -a eth1 -d 9999999999 -u 4096 # only limit upload
wondershaper -a eth1 -d 4096 -u 9999999999  # only limit download
sergeolkhovik commented 2 years ago

@HMWCS I installed wondershaper in Ubuntu 22.04 via apt and this is what I see:

if [ $# -eq 0 ]; then
  echo Please read the man page for the wondershaper and 
  echo the file /usr/share/doc/wondershaper/README.Debian.gz
  exit
fi

if [ $# -eq 1 ]; then
  /sbin/tc -s qdisc ls dev $1
  /sbin/tc -s class ls dev $1
  exit
fi

if [ $# -eq 2 ]; then
  /sbin/tc qdisc del dev $2 root    2> /dev/null > /dev/null
  /sbin/tc qdisc del dev $2 ingress 2> /dev/null > /dev/null
  echo Wondershaper queues have been cleared.
  exit
fi

if [ $# -ne 3 ]; then
  echo Please read the man page for the wondershaper and
  echo the file /usr/share/doc/wondershaper/README.Debian.gz
  exit
fi

I'd say it doesn't support any arguments as you give but looks like the Ubuntu's and the script in your repo are different. ii wondershaper 1.1a-10.1 all Easy to use traffic shaping script

Hmm, I'm sorry about that, I'll use the script from repo. Thanks for pointing that to me.