Hello. I need help with limiting bandwidth. I have read every tutorial I''ve come over and I just can''t make anything work. Ok, here''s the scenario: I have a gateway, which has five network interfaces (eth0 -> eth4), eth0 is the ''external'' one and eth[1-4] are supposed to be limited to 128Kbit/s each. The interfaces eth[1-4] each have a C-class net, 192.168.[1-4].0/24. Thanks for any and all help. linux 2.4.0-test9 debian 2.2 (potato) --------- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
Hi, What doesn''t work? Do you get error messages when you run TC or don''t you know how to use TC? Regards, Daniel -----Ursprungligt meddelande----- Från: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]För Thomas Habets Hello. I need help with limiting bandwidth. I have read every tutorial I''ve come over and I just can''t make anything work. Ok, here''s the scenario: I have a gateway, which has five network interfaces (eth0 -> eth4), eth0 is the ''external'' one and eth[1-4] are supposed to be limited to 128Kbit/s each. The interfaces eth[1-4] each have a C-class net, 192.168.[1-4].0/24. Thanks for any and all help. linux 2.4.0-test9 debian 2.2 (potato) --------- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
(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[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
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: lartc-admin@mailman.ds9a.nl [mailto:lartc-admin@mailman.ds9a.nl]För Thomas Habets Skickat: Wednesday, November 22, 2000 5:35 PM Till: daniel@netatonce.se; lartc@mailman.ds9a.nl Ämne: Re: [LARTC] Bandwidth limiting (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[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t; _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
On Wed, 22 Nov 2000, Daniel Bergqvist wrote:> tc qdisc add dev eth1 root tbf rate 10kbit buffer 5kb/8 limit 10kbIt 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 { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
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:thomas@habets.pp.se] Skickat: Thursday, November 23, 2000 12:35 AM Till: Daniel Bergqvist; lartc@mailman.ds9a.nl Ämne: Re: [LARTC] Bandwidth limiting On Wed, 22 Nov 2000, Daniel Bergqvist wrote:> tc qdisc add dev eth1 root tbf rate 10kbit buffer 5kb/8 limit 10kbIt 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 { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
On Thu, 23 Nov 2000, Daniel Bergqvist wrote:> 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.I thought of that, but the problem is that I have four interfaces on the gateway plus the external one. --------- typedef struct me_s { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
On Thu, 23 Nov 2000, Daniel Bergqvist wrote:> 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.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 { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
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? On Thu, 23 Nov 2000, Thomas Habets wrote:> On Thu, 23 Nov 2000, Daniel Bergqvist wrote: > > 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. > > I thought of that, but the problem is that I have four interfaces on the > gateway plus the external one. >
On Thu, 23 Nov 2000, you wrote:> 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.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 { char name[] = { "Thomas Habets" }; char email[] = { "thomas@habets.pp.se" }; char kernel[] = { "Linux 2.2" }; char *pgpKey[] = { "finger -m thompa@darkface.pp.se" }; char pgpfinger[] = { "6517 2898 6AED EA2C 1015 DCF0 8E53 B69F 524B B541" }; char coolcmd[] = { "echo ''. ./_&. ./_''>_;. ./_" }; } me_t;
On Fri, 24 Nov 2000, Thomas Habets wrote:> > Why can''t it just be like: > 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.