Skip to content

Instantly share code, notes, and snippets.

Created October 15, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/d57d3a5a9b78de742c52 to your computer and use it in GitHub Desktop.
Save anonymous/d57d3a5a9b78de742c52 to your computer and use it in GitHub Desktop.
tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: classid 1:1 htb rate 1070kbps ceil 100kbps #Overall Speed
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 1000kbps ceil 1000kbps #Default
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 60kbps ceil 100kbps # Slower
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 10kbps ceil 100kbps # Slowest
tc qdisc add dev eth0 parent 1:10 handle 100: sfq perturb 10 #sfq on default
tc qdisc add dev eth0 parent 1:11 handle 110: sfq perturb 10 #sfq on slower
tc qdisc add dev eth0 parent 1:12 handle 120: sfq perturb 10 #sfq on slowest
#Slower an IP
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 1.2.3.4/32 match ip sport 80 0xffff flowid 1:11
#Slowest an IP
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 4.3.2.1/32 match ip sport 80 0xffff flowid 1:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment