[vox-tech] Limiting Bandwidth with tc (and iptables)

Jan W jcwynholds at yahoo.com
Thu Jul 29 16:19:02 PDT 2004


Hi All:

I have seen some discussion about limiting bandwidth about a month ago, and I
thought that I would reiterate the tome of knowledge that allowed me to do it:

http://www.lartc.org/lartc.html

I think someone mentioned it earlier, but I never looked very deeply into it.

One thing that I would like to mention:

It says in the guide that setting rate limits on incoming connections is called
policing, and is accomplished with using the 'ingress' class.  However, using
iptables, you can mark incoming packets and send them to a (not ingress) class.

iptables -A PREROUTING -i eth0 -j MARK --set-mark 0x1

tc filter add dev eth0 parent [parent class] protocol ip prio 1 handle 1 fw
classid [your class]

Where [your class] and [parent class] can be any legit class(es) already
configured.  I use htb (the Heirarchical Token Bucket), but I think most should
work (I haven't played with the different ones that much)....  I'm still
playing with this, but in just 2 days of playing with it, I feel as though my
understanding of the networking in linux grew by an order of magnatude.

But the tc tool is just freakin' awesome.  There are best-of-breed management
systems that don't have half the capability of tc, and to have it FOR FREE.... 
OMG....  it just made my whole day, week, etc.  Just another reason why LINUX
REWLZ!  (I'm so happy I'm typing like a 10 year old.)

Any other pitfalls/experiences/caveats/what-have-you?  I'm interested to hear
why you use the different qdiscs, just to have some clue as why you would use
one or another.  I picked htb because of it's simplicity, but knowing the
(real-world) complexities that demand a the different qdiscs would help
enormously.

--cheers

jan

=====
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
Of course the people don't want war. But after all, it's the leaders 
of the country who determine the policy, and it's always a simple 
matter to drag the people along whether it's a democracy, a fascist 
dictatorship, or a parliament, or a communist dictatorship. 
Voice or no voice, the people can always be brought to the bidding 
of the leaders. That is easy. All you have to do is tell them they 
are being attacked, and denounce the pacifists for lack of patriotism, 
and exposing the country to greater danger.
     --Hermann Goering
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><


		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 


More information about the vox-tech mailing list