# based on: http://lartc.org/howto/lartc.cookbook.ultimate-tc.html tc qdisc del dev eth2 root tc qdisc del dev eth2 ingress tc qdisc add dev eth2 root handle 1: cbq avpkt 1000 bandwidth 10mbit tc class add dev eth2 parent 1: classid 1:1 cbq rate 100kbit allot 1500 prio 5 bounded isolated tc class add dev eth2 parent 1:1 classid 1:10 cbq rate 100kbit allot 1600 prio 1 avpkt 1000 tc class add dev eth2 parent 1:1 classid 1:20 cbq rate 90kbit allot 1600 prio 2 avpkt 1000 tc qdisc add dev eth2 parent 1:10 handle 10: sfq perturb 10 tc qdisc add dev eth2 parent 1:20 handle 20: sfq perturb 10 tc filter add dev eth2 parent 1:0 protocol ip prio 10 u32 match ip tos 0x10 0xff flowid 1:10 tc filter add dev eth2 parent 1:0 protocol ip prio 11 u32 match ip protocol 1 0xff flowid 1:10 tc filter add dev eth2 parent 1: protocol ip prio 12 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowid 1:10 tc filter add dev eth2 parent 1: protocol ip prio 13 u32 match ip dst 0.0.0.0/0 flowid 1:20 tc qdisc add dev eth2 handle ffff: ingress tc filter add dev eth2 parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 800kbit burst 10k drop flowid :1