who is the "right" parent in tc filter statements?
Borut Mrak [email protected]
<PRE>Hello!
My setup is quite simple:
I have a Linux router which does traffic shaping. All is well while each customer has separate bandwidth:
tc qdisc add dev eth0 root handle 10: cbq bandwidth 100Mbit avpkt 1000
tc class add dev eth0 parent 10:0 classid 10:1 cbq bandwidth 100Mbit rate \
256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000 bounded
tc qdisc add dev eth0 parent 10:1 sfq quantum 1514b perturb 15 tc filter add dev eth0 parent 10:0 protocol ip prio 100 u32 match ip src \
xxx.xx.xxx.xx flowid 10:1
Now I have two customers with a setup like this:
each has 256k bandwidth, but they should be able to share it between them if the other one doesn't use it (therefore I've left out the "bounded" part):
tc class add dev eth0 parent 10:0 classid 10:200 cbq bandwidth 100Mbit rate \
512kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000 bounded
tc class add dev eth0 parent 10:200 classid 10:201 cbq bandwidth 100Mbit rate \
256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000
tc qdisc add dev eth0 parent 10:201 sfq quantum 1514b perturb 15 tc filter add dev eth0 parent 10:200 protocol ip prio 100 u32 match ip src \
xxx.xxx.xx.29 flowid 10:201
tc class add dev eth0 parent 10:200 classid 10:202 cbq bandwidth 100Mbit rate \
256kbit allot 1514 weight 100kbit prio 5 maxburst 1 avpkt 1000
tc qdisc add dev eth0 parent 10:202 sfq quantum 1514b perturb 15 tc filter add dev eth0 parent 10:200 protocol ip prio 100 u32 match ip src \
xxx.xxx.xx.28 flowid 10:202
Now, did I do the right thing setting parent to 10:200 (the joint 512k class) in tc filter statements? If this is correct, it could be added to the howto. That part is missing in chapter 9.4 - Class subdivision.
thanks,
Signature · 8 lines
Borut <A HREF="mailto:[email protected]">[email protected]</A> ----------------- There *is* something on port 23 but it ain't TELNET... Zack Weinberg in Scary Devil Monastery. </PRE>