Need help with tc
Ok here's my situation:
I have a server on a 768kbit (upload) DSL line. I have two IP addresses, on eth0 and eth0:0.
One IP has hobby sites, and the other IP has business sites. If the bandwidth starts to get saturated, I want the business sites to always take prirority over the hobby sites, so that the business sites won't slow down.
This is what I have so far:
tc qdisc add dev eth0 root handle 1: cbq bandwidth 10Mbit cell 8 avpkt 1000 mpu 64 rate 700kbit
tc class add dev eth0 parent 1:0 classid 1:1 cbq bandwidth 10Mbit avpkt 1000 prio 1 bounded isolated allot 1514 weight 1 maxburst 21 rate 10MBit
tc class add dev eth0 parent 1:0 classid 1:2 cbq bandwidth 10Mbit avpkt 1000 prio 2 bounded isolated allot 1514 weight 1 maxburst 21 rate 10MBit
tc filter add dev eth0 parent 1:0 protocol ip prio 5 handle 1: u32 divisor 2
tc filter add dev eth0 parent 1:0 prio 5 u32 match ip src x.x.x.1 flowid 1:1
tc filter add dev eth0 parent 1:0 prio 5 u32 match ip src x.x.x.2 flowid 1:2
What this should do is first throttle the data to 700kbit, since if I don't then the delay will be in the DSL modem buffer and not the tc buffer. Then, I want to prioritize all of the traffic going out through one IP before the other one.
These commands run fine, but they don't seem to change anything at all, not even throttle the overall rate. I can throttle the bandwidth to the connection itself with:
tc qdisc add dev eth0 root tbf rate 700kbit latency 50ms burst 1540
I may be totally barking up the wrong tree, and there may be a much easier way to accomplish this. I've never even heard of tc before today. If so, please let me know.
Thanks.
|