root_device='eth0'
tc qdisc del dev $root_device dev root
tc qdisc add dev $root_device root handle 1: htb default 10
tc class replace dev $root_device parent 1:0 classid 1:$vlan_id htb rate $rate ceil $ceil prio 0
tc filter replace dev $root_device protocol 802.1q parent 1:0 prio 1 handle 800::$vlan_id u32 match ip dst "$subnet" match ip protocol 1 0xff flowid 1:$vlan_id