linux:skrypt_qos

!/bin/bash
tc qdisc del dev eth0 root > /dev/null 2>&1

tc qdisc add dev eth0 root handle 1: htb default 11
tc class add dev eth0 parent 1: classid 1:1 htb rate 500kbit ceil 500kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 225kbit ceil 500kbit prio 1
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 225kbit ceil 500kbit prio 1
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 50kbit ceil 500kbit prio 0
tc qdisc add dev eth0 parent 1:10 handle 2: sfq perturb 10
tc qdisc add dev eth0 parent 1:11 handle 3: sfq perturb 10
tc qdisc add dev eth0 parent 1:12 handle 4: sfq perturb 10

tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 1 match u8 0x10 0xff at 33 flowid 1:12

tc filter add dev eth0 protocol ip parent 1: prio 2 u32 match ip dport 80 0xffff flowid 1:10