Skip to contentSkip to conversation

Can I limit traffic rate to 5Mbps in both direction (in and out)

LARTC openings 4 participants 7 messages Apr 9, 2003 – Apr 14, 2003

lore
Share & tools
lore

openings

author
#0 lore raw

Hi.

I have two NIC in Linux machine.

One NIC is out direction(to WAN), the other is in direction(to LAN).

I want to limit traffic rate in both direction.
(total 5Mbps limit to destination port 80 traffic in both direction)

but I can limit in only one direction each.

How can I limit traffic in both direction ?

Thanks.ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿË™¨¥Šx%ŠË,S ùšŠYšŸ÷lõ¯ç–m§ÿÿ™¨¥™©ÿvÏZþy™¨¥™©ÿ–+-ŠwèþV«µÁÎY3ÿ†Ûiÿÿåj»\þŠà

#1 lore raw
Quoted 2 lines

I want to limit traffic rate in both direction.
(total 5Mbps limit to destination port 80 traffic in both direction)

Is it only port 80 you want to shape ?

Quoted 1 line

but I can limit in only one direction each.

You do that by shaping on outgoing traffic om each interface.

Outgoing on internal interface is downloading for your users. Outgoing on your external interface is uploading for your users.

//Jesper

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to openings
Quoted 4 lines · openings

Hi.

I have two NIC in Linux machine.

Quoted 8 lines

One NIC is out direction(to WAN), the other is in direction(to LAN).

I want to limit traffic rate in both direction.
(total 5Mbps limit to destination port 80 traffic in both direction)

but I can limit in only one direction each.

How can I limit traffic in both direction ?

You can do this if you patch the kernel and iptables so it supports the imq device. An imq device is a virutal device and you can put packets with iptables in it. You can also shape that device.
In your case, you need to create 1 imq device and redirect packets from both directions to port 80 to it. And add a tbf (or cbq or htb) qdisc to the imq device to limit the traffic to 5mbps.

For a link to the imq device, see the faq page on www.docum.org.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#3 lore raw
In reply to openings

Hi Stef

Continuation with your responce to this post
If i send all traffic to Imq, i can shape aggrigate B/w like either i can send 5Mb up or 5Mb down
but iam going to achive with this webserver total 5Mb, is this right

hare
----- Original Message -----
From: "Stef Coene" <[email protected]>
To: "openings" <[email protected]>; <[email protected]>
Sent: Thursday, April 10, 2003 2:24 AM
Subject: Re: [LARTC] Can I limit traffic rate to 5Mbps in both direction (in and out)

Quoted 7 lines · openings
Quoted 6 lines

Hi.

I have two NIC in Linux machine.

One NIC is out direction(to WAN), the other is in direction(to LAN).

Quoted 7 lines
Quoted 6 lines

I want to limit traffic rate in both direction.
(total 5Mbps limit to destination port 80 traffic in both direction)

but I can limit in only one direction each.

How can I limit traffic in both direction ?

You can do this if you patch the kernel and iptables so it supports the

imq

Quoted 3 lines

device. An imq device is a virutal device and you can put packets with iptables in it. You can also shape that device.
In your case, you need to create 1 imq device and redirect packets from

both

Quoted 1 line

directions to port 80 to it. And add a tbf (or cbq or htb) qdisc to the

imq

Quoted 8 lines

device to limit the traffic to 5mbps.

For a link to the imq device, see the faq page on www.docum.org.

Stef

--

Quoted 9 lines

[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#4 lore raw
In reply to openings
Quoted 6 lines · hare ram

Hi Stef

Continuation with your responce to this post
If i send all traffic to Imq, i can shape aggrigate B/w like either i can send 5Mb up or 5Mb down
but iam going to achive with this webserver total 5Mb, is this right

Yes. All traffic entering that imq device will be limited to 5Mb. And if you put upload + download traffic in it, download and upload will be limited together to 5mb.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#5 lore raw
In reply to openings

Hi

thanks for the reply
what will be the situation if its Transparent Bridge, how does the IMQ work on this situation

hare
----- Original Message -----
From: "Stef Coene" <[email protected]>
To: "hare ram" <[email protected]>; "openings" <[email protected]>; <[email protected]>
Sent: Thursday, April 10, 2003 11:16 PM
Subject: Re: [LARTC] Can I limit traffic rate to 5Mbps in both direction (in and out)

Quoted 8 lines · hare ram
Quoted 6 lines

Hi Stef

Continuation with your responce to this post
If i send all traffic to Imq, i can shape aggrigate B/w like either i can send 5Mb up or 5Mb down
but iam going to achive with this webserver total 5Mb, is this right

Yes. All traffic entering that imq device will be limited to 5Mb. And if

you

Quoted 13 lines

put upload + download traffic in it, download and upload will be limited together to 5mb.

Stef

--

[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#6 lore raw
In reply to openings
Quoted 5 lines · hare ram

Hi

thanks for the reply
what will be the situation if its Transparent Bridge, how does the IMQ work on this situation

I don't know.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/