LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 12-24-2006, 03:17 PM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 668
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 :

DEVICE=eth1,100Mbit,10Mbit
RATE=100Kbit
WEIGHT=10Kbit
PRIO=5
RULE=192.168.15.0/24

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 1.2.3.4/32 flowid 10:1

OR

# tc filter add dev eth1 protocol ip parent 1:0 prio 1 handle 6 fw flowid 1:1
# iptables -A PREROUTING -t mangle -s 1.2.3.4/32 -j MARK --set-mark 6

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

root 1:
|
_1:1_
/
/
/
10:
/
10: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 ! 192.168.128.16/28 -d \
192.168.128.16/28 -j MARK --set-mark 4
 
  


Reply


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 02:44 AM
I question about CBQ: please help me! ikillu Linux - Networking 1 09-25-2005 02:28 PM
question guys for those gurus golpemortal Linux - Wireless Networking 0 04-21-2005 12:52 AM
A question for Linux Gurus.... perry Linux - Software 1 05-28-2004 04:16 PM
A Question for all Linux Gurus esael Linux - General 12 10-17-2002 04:39 PM


All times are GMT -5. The time now is 10:14 AM.

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