l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Jul 30 02:08

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Limiting Bandwidth with tc (and iptables)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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:


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



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!
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.