From: Andy Furniss Date: Sat, 24 Mar 2007 12:47:51 +0000 Subject: Re: [LARTC] Shape own router Message-Id: <46051DF7.5030605@andyfurniss.entadsl.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Salatiel Filho wrote: > > Hi Andy , thanks again , but i am not understanding very well how to > do it [still newbie in this]. Let`s try to change to some real code > here. This is part of my setup to shape download: > > eth0 = EXTIF > eth1 = LOCALIF > > # SHAPE DOWNLOAD to LOCALNET NOT COMING FROM THE ROUTER ITSELF [samba > for example] > iptables -t mangle -s ! 192.168.254.254 -A POSTROUTING -o eth1 -j IMQ > --todev 1 If you shape your wan - eth0 using ifb on ingress or imq from prerouting then you do not need any rules on eth1, the wan traffic will already be shaped. If you do not plan on seperating users or interactive traffic from bulk traffic, it would actually be much nicer to use a policer for ingress wan traffic. Policing doesn't buffer traffic just drops it when a virtual buffer is full, so you won't be delaying interactive traffic by queuing with bulk. When you shape ingress wan, however you do it, you will need to sacrifice about 20% of your bandwidth, possibly more depending on needs/traffic/wan speed. Shaping from the wrong end of the bottleneck is better than doing nothing, but you can't do it perfectly. > > tc qdisc add dev imq1 root handle 1: htb default 3 r2q 1 // > DOWNLOAD SHAPER ROOT > tc class add dev imq1 parent 1: classid 1:1 htb rate 2048kbit quantum > 1500 //KNOWN TRAFFIC GOES HERE > tc class add dev imq1 parent 1: classid 1:3 htb rate 8kbit quantum > 1500 // DEFAULT CLASS VERYYYYY SLOWWWWWWW If this were eth rather than imq you would be sending arp to a slow class - not nice. Andy. _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc