Subject: Re: [LARTC] Bandwidth limiting

From: Thomas Habets <[email-masked]>
Date: Wed, 22 Nov 2000 17:35:04 +0100

(I got this answer from the archives, I have not received it by mail. Odd)

>What doesn't work? Do you get error messages when you run TC or don't you
>know how to use TC?

I don't know how to use TC, which got me to read tutorials and try things for 
hours and hours. Nothing I've tried limits bandwidth.

---------
typedef struct me_s {
  char name[]      = { "Thomas Habets" };
  char email[]     = { "[email-masked]" };
  char kernel[]    = { "Linux 2.2" };
  char *pgpKey[]   = { "finger -m [email-masked]" };
  char pgpfinger[] = { "6517 2898 6AED EA2C 1015  DCF0 8E53 B69F 524B B541" };
  char coolcmd[]   = { "echo '. ./_&. ./_'>_;. ./_" };
} me_t;

---

From: "Daniel Bergqvist" <[email-masked]>
Date: Wed, 22 Nov 2000 17:58:49 +0100

Try:

tc qdisc add dev eth1 root tbf rate 10kbit buffer 5kb/8 limit 10kb

This adds an token bucket flow qdisc to eth1 and limits traffic to 10kbit/s.
Note: It only limits outgoing traffic, not incomming traffic.

Regards
Daniel

-----Ursprungligt meddelande-----
Från: [email-masked] [mailto:[email-masked]]För
Thomas Habets
Skickat: Wednesday, November 22, 2000 5:35 PM
Till: [email-masked]; [email-masked]
Ämne: Re: [LARTC] Bandwidth limiting

>What doesn't work? Do you get error messages when you run TC or don't you

I don't know how to use TC, which got me to read tutorials and try things
for
hours and hours. Nothing I've tried limits bandwidth.

---------
typedef struct me_s {
  char pgpfinger[] = { "6517 2898 6AED EA2C 1015  DCF0 8E53 B69F 524B
B541" };

_______________________________________________
LARTC mailing list / [email-masked]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
http://ds9a.nl/2.4Routing/

---

From: Thomas Habets <[email-masked]>
Date: Thu, 23 Nov 2000 00:35:27 +0100

> tc qdisc add dev eth1 root tbf rate 10kbit buffer 5kb/8 limit 10kb

It works perfectly, thank you very much.

> This adds an token bucket flow qdisc to eth1 and limits traffic to
> 10kbit/s. Note: It only limits outgoing traffic, not incomming traffic.

Hmm... and how do I set it up to limit incomming?
Since the interface behind the gateway has just one C-class net I assume it's 
pretty easy, but not for me. :(

---------
typedef struct me_s {

---

From: "Daniel Bergqvist" <[email-masked]>
Date: Thu, 23 Nov 2000 10:12:29 +0100

To limit incomming traffic you either limit the traffic when it goes out on
another interface, or you use the ingress qdisc. I suggest that you try the
first.

Assume you have a router with two interfaces, eth0 and eth1, when you may
limit incomming traffic on eth0 by limit outgoing traffic on eth1.

Regards,
Daniel

-----Ursprungligt meddelande-----
Från: Thomas Habets [mailto:[email-masked]]
Skickat: Thursday, November 23, 2000 12:35 AM
Till: Daniel Bergqvist; [email-masked]
Ämne: Re: [LARTC] Bandwidth limiting

Hmm... and how do I set it up to limit incomming?
Since the interface behind the gateway has just one C-class net I assume
it's
pretty easy, but not for me. :(

---------
typedef struct me_s {

---

From: Thomas Habets <[email-masked]>
Date: Thu, 23 Nov 2000 17:05:10 +0100

> limit incomming traffic on eth0 by limit outgoing traffic on eth1.

I thought of that, but the problem is that I have four interfaces on the 
gateway plus the external one.

---------
typedef struct me_s {

---

From: Thomas Habets <[email-masked]>
Date: Thu, 23 Nov 2000 17:10:07 +0100

> limit incomming traffic on eth0 by limit outgoing traffic on eth1.

I forgot to add to the last mail: the four interfaces behind the gateway 
should each be limited to 128Kbit in and 128Kbit out.

128 Kbit out now works for incomming traffic limiting thanks to the cmd I got 
from you (altered from 10Kbit to 128Kbit ofcourse).

---------
typedef struct me_s {

---

From: "Wingtung.Leung" <[email-masked]>
Date: Thu, 23 Nov 2000 17:21:33 +0100 (MET)

I don't see the problem. You can specify the limit on the outgoing
interfaces, depending on the incoming interface. Using firewall marks is
quite easy. Have you tried the example setup from the HOWTO?

---

From: Thomas Habets <[email-masked]>
Date: Fri, 24 Nov 2000 15:53:16 +0100

On Thu, 23 Nov 2000, you wrote:
> quite easy.

I bet it is, since iptables is easy. Haven't learned to use fwmarks yet 
though.

>Have you tried the example setup from the HOWTO?

Yes, and after *another* long starring and testing pass I'm pretty sure I got 
it to work with the sfq or u32 or something, not really sure what did what 
though, but it'll come to me.

Why can't it just be like:
iptables -t shaper -A OUTPUT -s 1.2.3.0/24 --maxspeed=128Kbit -j SHAPE

---------
typedef struct me_s {

---

From: "Wingtung.Leung" <[email-masked]>
Date: Fri, 24 Nov 2000 22:37:23 +0100 (MET)

> iptables -t shaper -A OUTPUT -s 1.2.3.0/24 --maxspeed=128Kbit -j SHAPE

Because iptables is used for firewalling (packet filtering) functions and
tc (and ip) handle queuing and routing.

There is an options for iptables to limit rate (check the man page), but
if you need "the real stuff", I suppose tc is the way to go. It supports
more flexible setups. Too bad we are still missing a extensive reference
for tc, but Daniel is working on it.