Skip to content

Instantly share code, notes, and snippets.

@kascote
Created October 29, 2009 20:18
Show Gist options
  • Save kascote/221775 to your computer and use it in GitHub Desktop.
Save kascote/221775 to your computer and use it in GitHub Desktop.
#!/bin/sh
case "$1" in
start)
tc qdisc add dev lo root handle 1: htb default 1
tc class add dev lo parent 1: classid 1:1 htb rate 80kbps #ceil 80kbps
tc filter add dev lo protocol ip parent 1: prio 1 u32 match ip dport 80 0xffff flowid 1:1
;;
status)
tc -s qdisc ls dev lo
echo "~~~"
tc -s class ls dev lo
echo "~~~"
tc -s filter ls dev lo
;;
stop)
tc qdisc del dev lo root
;;
*)
echo "usage: ./shaper start|status|stop"
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment