Results 1 to 1 of 1
Hi I have been trying to limit the traffic of each of the 10 hosts on my LAN to 10kbyte/s for the download of each host I have tried the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-24-2006 #1
- Join Date
- Dec 2006
CBQ question for gurus
Hi I have been trying to limit the traffic of each of the 10 hosts on my LAN to 10kbyte/s for the download of each host I have tried the following two approaches with the same result (The bandwidth for the whole network is limitied to 10kbyte/s instead of a per host basis)
Ive tried cbq.init using the following config file :
And Ive read LARTC and Ive setup my own configuration with the same result as above, the question "posted to the lartc mailing list" is stated below :
Hi Ive been reading, testing and applying what Iam reading in the
LARTC tutorial for a couple of days, I do not wish to use ready made
scripts because that means I will always come back and ask the same
So Ive been wondering if I have 10 computers and I do want to limit
the download for each of those 10 computers to 10 kbyte per second. I
would create a leaf class and match the traffic that comes from those
networks using either (below are only example cases to explain my
# tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
match ip src 126.96.36.199/32 flowid 10:1
# tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 6 fw flowid 1:1
# iptables -A PREROUTING -t mangle -s 188.8.131.52/32 -j MARK --set-mark 6
And let's suppose I created my classes like this diagram :
If I have the hierachy displayed above, and that the leaf class 10:1
is the class that limits the download rate to my requested 10 kbyte
per second. Using either of the matches above will redirect all
matched packets through the filter of the matching class. But in this
case cumulative bandwidth of the traffic computers on the matching
network will be limited to 10kbyte.
What do I have to do so that the traffic of each host on the network
will get a download limit of 10 kbyte per second.
Do I have to create classes 10:n where n is the number of hosts, or do
I have to change my matching pattern. Or can I create a class that
will match the traffic of each host in the network individually ?
Below is my current setup :
tc qdisc add dev eth2 root handle 11: cbq bandwidth 100Mbit avpkt \
1000 mpu 64
tc class add dev eth2 parent 11:0 classid 11:1 cbq rate 100Kbit \
weight 10Kbit allot 1514 prio 1 avpkt 1000 bounded
tc filter add dev eth2 parent 11:0 protocol ip handle 4 fw flowid 11:1
iptables -t mangle -A POSTROUTING -s ! 192.168.128.16/28 -d \
192.168.128.16/28 -j MARK --set-mark 4