All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Control Bandwidth
@ 2004-04-01 15:00 andybr
  2004-04-01 19:21 ` Alessandro O. Ungaro
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: andybr @ 2004-04-01 15:00 UTC (permalink / raw)
  To: lartc

Hi all,

I need a little help, i am studing htb to control user 
bandwidth (download/upload) and I made a script as 
below to test. I am testing using ttcp tool from by 
linux box to other linux (192.168.200.51).
my box <---- Linux = more than 128kbit
mybot -----> Linux = get 128kbit

But I want to control both ways, what am I missing?


script:
EXTIF=eth0
INTIF=eth1
TC=/sbin/tc
DOWN\x128
UPd
IP\x192.168.200.201
##################
#
$TC qdisc del $EXTIF root 2> /dev/null > /dev/null
#
$TC qdisc add dev $EXTIF root handle 0: htb default 1
$TC class add dev $EXTIF parent 0: classid 1 htb rate 
128Kbit ceil 128Kbit
#
$TC filter add dev $EXTIF protocol ip parent 0:0 prio 1 
u32 match ip src $IP flowid 1
$TC filter add dev $EXTIF protocol ip parent 0:0 prio 1 
u32 match ip dst $IP flowid 1

Thanks,
Anderson

 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] Control Bandwidth
  2004-04-01 15:00 [LARTC] Control Bandwidth andybr
@ 2004-04-01 19:21 ` Alessandro O. Ungaro
  2004-04-01 20:47 ` Roy
  2004-04-02  8:26 ` Adrian Saileanu
  2 siblings, 0 replies; 4+ messages in thread
From: Alessandro O. Ungaro @ 2004-04-01 19:21 UTC (permalink / raw)
  To: lartc

Anderson,

the problem is:

the flow control in your script is only to EXTIF (External Interface), 
so.., I think you have a network behind a NAT. The EXTIF doesn't recieve 
the internal IP becouse the NAT translate this.

I think this is your error.

Try to keep a down-rule in the INTIF to make a 128k restricted link to 
your "box".

[]'s

x-arnie


andybr wrote:

> Hi all,
> 
> I need a little help, i am studing htb to control user 
> bandwidth (download/upload) and I made a script as 
> below to test. I am testing using ttcp tool from by 
> linux box to other linux (192.168.200.51).
> 
> my box <---- Linux = more than 128kbit
> mybot -----> Linux = get 128kbit
> 
> But I want to control both ways, what am I missing?
> 
> 
> script:
> 
> EXTIF=eth0
> INTIF=eth1
> TC=/sbin/tc
> DOWN\x128
> UPd
> IP\x192.168.200.201
> ##################
> #
> $TC qdisc del $EXTIF root 2> /dev/null > /dev/null
> #
> $TC qdisc add dev $EXTIF root handle 0: htb default 1
> 
> $TC class add dev $EXTIF parent 0: classid 1 htb rate 
> 128Kbit ceil 128Kbit
> #
> $TC filter add dev $EXTIF protocol ip parent 0:0 prio 1 
> u32 match ip src $IP flowid 1
> $TC filter add dev $EXTIF protocol ip parent 0:0 prio 1 
> u32 match ip dst $IP flowid 1
> 
> Thanks,
> Anderson
> 
>  
> __________________________________________________________________________
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - É grátis!
> http://antipopup.uol.com.br/
> 
> 
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
> 

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] Control Bandwidth
  2004-04-01 15:00 [LARTC] Control Bandwidth andybr
  2004-04-01 19:21 ` Alessandro O. Ungaro
@ 2004-04-01 20:47 ` Roy
  2004-04-02  8:26 ` Adrian Saileanu
  2 siblings, 0 replies; 4+ messages in thread
From: Roy @ 2004-04-01 20:47 UTC (permalink / raw)
  To: lartc

This script will not work for upload unles used on my imq interface.
or umless used on separate computer which works as bridge.
or if you DO NOT use nat.

only download shaping will work in other case.
or you must mark upload packets in prerouting chain.
because else tc will see only your server's  ip



----- Original Message ----- 
From: "andybr" <andybr@bol.com.br>
To: "Lartc List" <lartc@mailman.ds9a.nl>
Sent: Thursday, April 01, 2004 6:00 PM
Subject: [LARTC] Control Bandwidth


Hi all,

I need a little help, i am studing htb to control user
bandwidth (download/upload) and I made a script as
below to test. I am testing using ttcp tool from by
linux box to other linux (192.168.200.51).
my box <---- Linux =ore than 128kbit
mybot -----> Linux =et 128kbit

But I want to control both ways, what am I missing?


script:
EXTIF=h0
INTIF=h1
TC=bin/tc
DOWN\x128
UPd
IP\x192.168.200.201
##################
#
$TC qdisc del $EXTIF root 2> /dev/null > /dev/null
#
$TC qdisc add dev $EXTIF root handle 0: htb default 1
$TC class add dev $EXTIF parent 0: classid 1 htb rate
128Kbit ceil 128Kbit
#
$TC filter add dev $EXTIF protocol ip parent 0:0 prio 1
u32 match ip src $IP flowid 1
$TC filter add dev $EXTIF protocol ip parent 0:0 prio 1
u32 match ip dst $IP flowid 1

Thanks,
Anderson


__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LARTC] Control Bandwidth
  2004-04-01 15:00 [LARTC] Control Bandwidth andybr
  2004-04-01 19:21 ` Alessandro O. Ungaro
  2004-04-01 20:47 ` Roy
@ 2004-04-02  8:26 ` Adrian Saileanu
  2 siblings, 0 replies; 4+ messages in thread
From: Adrian Saileanu @ 2004-04-02  8:26 UTC (permalink / raw)
  To: lartc


  You are haveing tow major mistakes here which will make your script to
have no efect over the $EXTIF, except the rate of 128k for uploading for
everything that goes out of your box.

  Having a private ip which later will be SNATed , MASQed and because
shaping will be done after POSTROUTING ( even for nat, mangle tables )
when a packet which arrives on the external interface will have as
source the PUBLIC IP. So filter $TC filter add dev $EXTIF protocol ip
parent 0:0 prio 1 u32 match ip src $IP flowid 1 will not match any
packet.

  Check the "http://www.docum.org/stef.coene/qos/kptd/" page. It is very
usefull.

  Second, on external interface you will never have packets with dst $IP
... what will mean a packet with dst $IP ? It means that a machine which
has a network device with the ip = $IP should be somewhere on the
internet ( behind $EXTIF ) ... but in reality, this machine is behind
the $INTIF. So filter $TC filter add dev $EXTIF protocol ip parent 0:0
prio 1 u32 match ip dst $IP flowid 1 will not match any packet.


> Hi all,
>
> I need a little help, i am studing htb to control user
> bandwidth (download/upload) and I made a script as
> below to test. I am testing using ttcp tool from by
> linux box to other linux (192.168.200.51).
> my box <---- Linux = more than 128kbit
> mybot -----> Linux = get 128kbit
>
> But I want to control both ways, what am I missing?
>
>
> script:
> EXTIF=eth0
> INTIF=eth1
> TC=/sbin/tc
> DOWN\x128
> UPd
> IP\x192.168.200.201
> ##################
> #
> $TC qdisc del $EXTIF root 2> /dev/null > /dev/null
> #
> $TC qdisc add dev $EXTIF root handle 0: htb default 1
> $TC class add dev $EXTIF parent 0: classid 1 htb rate
> 128Kbit ceil 128Kbit
> #
> $TC filter add dev $EXTIF protocol ip parent 0:0 prio 1
> u32 match ip src $IP flowid 1
> $TC filter add dev $EXTIF protocol ip parent 0:0 prio 1
> u32 match ip dst $IP flowid 1
>
> Thanks,
> Anderson
>
>
> __________________________________________________________________________
> Acabe com aquelas janelinhas que pulam na sua tela.
> AntiPop-up UOL - É grátis!
> http://antipopup.uol.com.br/
>
>
> _______________________________________________
> LARTC mailing list / LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
>


Adrian Saileanu
Netmaster Communications Srl

address: Str. Ion Brezoianu Nr. 20
Sector 1, Bucuresti, Romania

office: +40 21 315 92 00
mobile: +40 723 979 586
email:   adrian@smartcall.ro





_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-02  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-01 15:00 [LARTC] Control Bandwidth andybr
2004-04-01 19:21 ` Alessandro O. Ungaro
2004-04-01 20:47 ` Roy
2004-04-02  8:26 ` Adrian Saileanu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.