Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 12-24-2006, 02:17 PM   #1
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 670
Blog Entries: 7

Rep: Reputation: 31
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
question again.

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
point) :

# tc filter add dev eth0 parent 10:0 protocol ip prio 1 u32 \
match ip src 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 -j MARK --set-mark 6

And let's suppose I created my classes like this diagram :

root 1:

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 ! -d \ -j MARK --set-mark 4


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CBQ.init upload question ALInux Linux - Networking 3 08-16-2007 01:44 AM
I question about CBQ: please help me! ikillu Linux - Networking 1 09-25-2005 01:28 PM
question guys for those gurus golpemortal Linux - Wireless Networking 0 04-20-2005 11:52 PM
A question for Linux Gurus.... perry Linux - Software 1 05-28-2004 03:16 PM
A Question for all Linux Gurus esael Linux - General 12 10-17-2002 03:39 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration