<br><br><div><span class="gmail_quote">On 3/24/07, <b class="gmail_sendername">Andy Furniss</b> <<a href="mailto:lists@andyfurniss.entadsl.com">lists@andyfurniss.entadsl.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;">
Salatiel Filho wrote:<br><br>><br>> Hi Andy , thanks again , but i am not understanding very well how to<br>> do it [still newbie in this]. Let`s try to change to some real code<br>> here. This is part of my setup to shape download:
<br>><br>> eth0 = EXTIF<br>> eth1 = LOCALIF<br>><br>> # SHAPE DOWNLOAD to LOCALNET NOT COMING FROM THE ROUTER ITSELF [samba<br>> for example]<br>> iptables -t mangle -s ! <a href="http://192.168.254.254">
192.168.254.254</a> -A POSTROUTING -o eth1 -j IMQ<br>> --todev 1<br><br>If you shape your wan - eth0 using ifb on ingress or imq from prerouting<br>then you do not need any rules on eth1, the wan traffic will already be
<br>shaped.<br><br>If you do not plan on seperating users or interactive traffic from bulk<br>traffic, it would actually be much nicer to use a policer for ingress<br>wan traffic. Policing doesn't buffer traffic just drops it when a
<br>virtual buffer is full, so you won't be delaying interactive traffic by<br>queuing with bulk.<br><br>When you shape ingress wan, however you do it, you will need to<br>sacrifice about 20% of your bandwidth, possibly more depending on
<br>needs/traffic/wan speed. Shaping from the wrong end of the bottleneck is<br>better than doing nothing, but you can't do it perfectly.<br><br>><br>> tc qdisc add dev imq1 root handle 1: htb default 3 r2q 1 //
<br>> DOWNLOAD SHAPER ROOT<br>> tc class add dev imq1 parent 1: classid 1:1 htb rate 2048kbit quantum<br>> 1500 //KNOWN TRAFFIC GOES HERE<br>> tc class add dev imq1 parent 1: classid 1:3 htb rate 8kbit quantum
<br>> 1500 // DEFAULT CLASS VERYYYYY SLOWWWWWWW<br><br>If this were eth rather than imq you would be sending arp to a slow<br>class - not nice.<br><br>Andy.<br><br></blockquote></div><br>I was finally able to shape the router itself :) , i changed IMQ default behaviour to AFTER NAT in Prerouting and BEFORE NAT in Postrouting.
<br>I do not know if my setup is common , but i have some like this:<br><br><br>DOWNLOAD LINK [1024K] -> HTB<br> PEOPLE [500k-1024ceil]<br> guy1 [100k-1000ceil]<br> guy2 [100k-1000ceil]
<br> guy3 [100k-1000ceil]<br> guy4 [100k-1000ceil]<br>
guy5 [100k-1000kceil] <br><br> ROUTER[512k-1000ceil] -> router and P2P BOX 24/7 [Before be able to shape the router , i need to hard limit the download speed to not eat all bandwidth, now i can let it borrow if there is available bandwidth in the parent (DOWNLOAD LINK)] -> I really need this 512k rate guaranteed in the router.
<br><br> DEFAULT[8k-8k] -> In theory should not be used by anyone :)<br><br> <br><br>But now i have a doubt , when a packet gets in too htb it will be queued , right ? If it is, is there a way to drop it if it is over the ceil limit ? I really do not want packets being queued `cause probably wiill delay the interactive traffic. Despite that , my setup is working great , that is just a doubt :)
<br><br clear="all"><br>-- <br>[]'s<br>Salatiel<br><br>"O maior prazer do inteligente é bancar o idiota <br> diante de um idiota que banca o inteligente".