<p>Hi Paolo Malfatti,</p><br><p><br>Thanks for your script. I tried it . <br></p><p> But I still <span style="font-weight: bold;">can no</span>t allocate 64 kbit for LAN. We have a 256 kbit link. We usually download around @ 30-33 kbytes per second. That means, when it comes to kbits, I will have to mulitple it in to 8 as
<span style="font-weight: bold;">
1kbps=8kbit .</span></p><p>pls see below for <span style="font-weight: bold;">usual</span> <span style="font-weight: bold;">download</span> rate, <span style="font-weight: bold;">before</span> applying your rules. <br><span style="font-weight: bold;">
</span></p><p><span style="font-weight: bold;">[root@worldnet wget]# wget <a href="http://mirrors.kernel.org/centos/5.0/isos/i386/CentOS-5.0-i386-bin-6of6.iso">http://mirrors.kernel.org/centos/5.0/isos/i386/CentOS-5.0-i386-bin-6of6.iso
</a><br>--12:16:27-- <a href="http://mirrors.kernel.org/centos/5.0/isos/i386/CentOS-5.0-i386-bin-6of6.iso">http://mirrors.kernel.org/centos/5.0/isos/i386/CentOS-5.0-i386-bin-6of6.iso</a><br> => `CentOS-5.0-i386-bin-6of6.iso.1
'<br>Resolving mirrors.kernel.org... <a href="http://204.152.191.7">204.152.191.7</a>, <a href="http://204.152.191.39">204.152.191.39</a><br>Connecting to mirrors.kernel.org|204.152.191.7|:80... connected.<br>HTTP request sent, awaiting response... 200 OK
<br>Length: 407,005,184 (388M) [application/x-iso9660-image]<br><br> 0% [ ] 2,749,752 30.10K/s ETA 4:43:0<br></span></p><br><p>Then, I applied your rules. pls see below
<br></p><p><br></p><p>INTERFAZ_INT=eth0 </p>
<p>FULLBANDWIDTH=256</p>
<p>BANDWIDTH4LAN=64</p>
<p>iptables -t mangle -A PREROUTING -s <a href="http://192.168.102.0/24" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">192.168.101.0/24</a> -j MARK --set-mark 0x5</p>
<p>tc qdisc add dev $INTERFAZ_INT root handle 1 htb r2q 4<br>tc class add dev $INTERFAZ_INT parent 1: classid 1:2 htb rate "$FULLBANDWIDTH"Kbit<br>tc class add dev $INTERFAZ_INT parent 1: classid 1:5 htb rate "$BANDWIDTH4LAN"Kbit
<br>tc qdisc add dev $INTERFAZ_INT parent 1:5 handle 5 sfq perturb 10<br>tc filter add dev $INTERFAZ_INT protocol ip parent 1: pref 1 handle 5 fw classid 1:5</p><br>Still no luck. after applying rules, I downloaded an centos ISO image. But , I still can download @ usual rate. (
i.e 30-33 kbytes per seconds). <br><br>If your rules work, I will be able to download @ about 8 kbyes per second. (i.e - 8*8 kbit= 64 kbit)<br><br>That is what I expect ? <br><br>Where have I gone wrong? <br><br><br><br><br>
<div><span class="gmail_quote">On 8/7/07, <b class="gmail_sendername">Pio Mendez</b> <<a href="mailto:pio_mendez@hotmail.com">pio_mendez@hotmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><span class="q"><div><font style="font-size: 11px; font-family: tahoma,sans-serif;">>What is r2q ad 4 there ?. I do not understand those two.<br></font></div></span>
<div><font style="font-size: 11px; font-family: tahoma,sans-serif;">I recommend you to read this: </font></div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<p><a href="http://luxik.cdi.cz/%7Edevik/qos/htb/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://luxik.cdi.cz/~devik/qos/htb/<font style="font-size: 11px; font-family: tahoma,sans-serif;">
</font></a></p></div></blockquote>
<p><font style="font-size: 11px; font-family: tahoma,sans-serif;">the r2q is a divisor used to calculate the quantum of htb (the amount of bytes that will be transmitted before serving another class: quantum = rate / r2q).
</font></p><span class="q">
<p>>tc qdisc add dev $INTERFAZ_INT parent 1:5 handle 5 sfq perturb 10</p>
<div> >What is this above rule?, I don not understand at all. <br></div></span>
<div>a must: <a href="http://lartc.org/howto/lartc.qdisc.html" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lartc.org/howto/lartc.qdisc.html</a></div>
<div> </div>
<div>The classes do shape of traffic, but you need a Queue manager to trasmit it (qdisc rule). Here you will find an example of HTB script: <a href="http://lartc.org/howto/lartc.qdisc.classful.html#AEN1072" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lartc.org/howto/lartc.qdisc.classful.html#AEN1072</a></div><span class="q">
<div> </div>
<div>>tc filter add dev $INTERFAZ_INT protocol ip parent 1: pref 1 handle 10 fw classid 1:5</div>
</span><div><span class="q">>I do not understand the above rule too.<br><br></span>there is an error: the right filter rule is: </div>
<div>tc filter add dev $INTERFAZ_INT protocol ip parent 1: pref 1 handle 5 fw classid 1:5</div>
<div> </div>
<div>The filter rule filter the traffic and send the mathing packets to the right class. </div>
<div>The iptables MARK rule mark the traffic before the SNAT. Later, after all iptables processing, the packets are filtered by this rule; if some packet match the "handle 5" filter (packet marked with 5 by the iptables rule will
</div>
<div>match) then it will be shaped by htb class to 64kbps. </div>
<div> </div>
<div>Hope this will help</div>
<div>Regards</div>
<div>Paolo Malfatti</div><span class="ad">
<div> </div></span></div><span class="ad"><br clear="all"><hr>MSN Amor <a href="http://g.msn.com/8HMAES/2740??PS=47575" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Busca tu ½ naranja</a>
</span></blockquote></div><br><br clear="all"><br>-- <br>Thank you<br>Indunil Jayasooriya<br>