Re: HTB classifying

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Martin Brown has right but his answer is not full.
I see at least one error in your script.
I see you arew shaping on wlan0. You must know that you can only shape
outgoing traffic so if your node is downloading by ftp i'ts ok, but if the
node start to upload shaping on wlan0 won't work. In that case you must
shape on eth0.
And second thing:
Because you shape towards 192.168.2.224 you can not write ...ip src
192.168.2.224/32.....
You must write ...ip dst 192.168.2.224.
>/sbin/tc filter add dev wlan0 parent 1:0 protocol ip prio 100 u32 \
>       match ip src 192.168.2.224/32 \
>      match ip sport 80 0xffff classid 1:11
Take some more reading :)
Good luck.
----- Original Message ----- 
From: "Mpourtounis Dimitris" <db@xxxxxxxx>
To: "lartc" <lartc@xxxxxxxxxxxxxxx>
Sent: Saturday, July 24, 2004 11:39 PM
Subject: Re:  HTB classifying


> Ok then...
>
> BOX with 2 ifaces
> eth0 :     192.168.1.3/24 , NAT 192.168.2.0/24
> wlan0:    192.168.2.3/24 ,
>
> gw 192.168.1.1(it is an adsl mode in fact)
>
> All i want to do is make sure that
>     a)node 192.168.2.224 doesnt get more than 500000 bits/sec
>     b)its ssh,sftp (port 22) traffic is limited at 300000 bits/sec
>
> and
>     c)add more shaped nodes in my script.
>
> When i start downloading from node, its http taffic for examle is really
> shaped
> at 500000.
> When i start downloading via sftp (port 22), its sftp traffic is really
> shaped
> at 300000.
> But, if when there is an http as well as an sftp session at the same time,
> total bandwidth
> is at 800000.
>
> Thanks in advance (and sorry for being so short, i will get used to
> explaining my problems
> briefly...)
>
>
> #My.notworking.script
> /sbin/tc qdisc add  dev wlan0 root handle 1:0 htb r2q 100
> /sbin/tc class add dev wlan0 parent 1: classid 1:10 htb rate 500000
>
> /sbin/tc class add dev wlan0 parent 1:10 classid 1:11 htb rate 300000
> /sbin/tc filter add dev wlan0 parent 1:0 protocol ip prio 100 u32 \
>         match ip src 192.168.2.224/32 \
>         match ip sport 80 0xffff classid 1:11
>
> /sbin/tc class add dev wlan0 parent 1:10 classid 1:12 htb rate 500000
>  /sbin/tc filter add dev wlan0 parent 1:0 protocol ip prio 100 u32 match \
>          ip src 192.168.2.224/32 classid 1:12
>
>
>
> ----- Original Message ----- 
> From: <mjoachimiak@xxxxxxxxxxxxxx>
> To: "lartc" <lartc@xxxxxxxxxxxxxxx>; "Mpourtounis Dimitris" <db@xxxxxxxx>
> Sent: Friday, January 24, 2003 2:13 AM
> Subject: Re:  HTB classifying
>
>
> > OK what's the address of eth0?  Is the BOX with NAT ?
> > I think you could send a bit of your true script and describe a bit of
> your
> > network especially the part when this situation is happeniing . If you
> > really afraid of smth like hack attack change IP adressess.
> >
> > > Although i have done so ,you are right. I should have included this
too
> in
> > > my (e-mail) configuration...
> > > BTW,Any idea of the situation
> > >
> > > ----- Original Message ----- 
> > > From: <mjoachimiak@xxxxxxxxxxxxxx>
> > > To: "lartc" <lartc@xxxxxxxxxxxxxxx>; "Mpourtounis Dimitris"
> <db@xxxxxxxx>
> > > Sent: Friday, January 24, 2003 1:21 AM
> > > Subject: Re:  HTB classifying
> > >
> > >
> > > > Maybe it's my oversight but shoudn't you have "tc qdisc add  dev
eth0
> > root
> > > > handle 1:0 htb"  before rest of your instructions ??
> > > >
> > > > > I am trying to shape a client (somewhat advanced).
> > > > >
> > > > > This is my target:
> > > > > Client is 192.168.2.224. I would like to allow him to download
with
> > > > > 500000 bits/sec in general. But, for a specific port(say 22), i
> would
> > > > > like him to download with 300000 bit/sec only. The problem is that
> my
> > > > > configuration (maybe wrong) allows him to download with 800000
> > bit/sec.
> > > > > (500000 generally + 300000 on port 22)
> > > > > I thought that having classes 1:11 and 1:12 being children of a
> class
> > > > > with rate 500000, 500000 would be the maximum...
> > > > > Can htb to this? Can another queue do this?
> > > > >
> > > > > /sbin/tc class add dev eth0 parent 1: classid 1:10 htb rate 500000
> > > > >
> > > > > /sbin/tc class add dev eth0 parent 1:10 classid 1:11 htb rate
300000
> > > > > /sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32
> match
> > > ip
> > > > src 192.168.2.224/32 \
> > > > > match ip sport 80 0xffff classid 1:11
> > > > >
> > > > > /sbin/tc class add dev eth0 parent 1:10 classid 1:12 htb rate
500000
> > > > > /sbin/tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32
> match
> > > ip
> > > > src 192.168.2.224/32 classid 1:12
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> > > > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO:
> http://lartc.org/
> > >
> > >
> >
>
>
> _______________________________________________
> LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
> http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux