From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Beverley Date: Tue, 05 Feb 2013 07:33:08 +0000 Subject: RE: Tc does not seem to be limiting bandwidth Message-Id: <1360049588.30430.87.camel@andrew-desktop> List-Id: References: <000101ce00b1$2856c670$79045350$@JAMMConsulting.com> In-Reply-To: <000101ce00b1$2856c670$79045350$@JAMMConsulting.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org On Mon, 2013-02-04 at 18:11 -0600, Neil Aggarwal wrote: > Andrew: > > > Can you post your rules that are/aren't working please? > > Here are the rules I am using. They throttle the bandwidth into > the VPS just fine, but they are not working to throttle the bandwidth > out of the VPS: > > IP=a.b.c.d > DEV=v1208 > /sbin/tc qdisc del dev $DEV root > /sbin/tc qdisc add dev $DEV root handle 1: htb default 30 > /sbin/tc class add dev $DEV parent 1: classid 1:1 htb rate 500kbit > /sbin/tc class add dev $DEV parent 1: classid 1:2 htb rate 500kbit > /sbin/tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip dst $IP flowid 1:1 > /sbin/tc filter add dev $DEV protocol ip parent 1:0 prio 1 u32 match ip src $IP flowid 1:2 Assuming that these are your only rules, these will be doing the egress from device v1208, which I am assuming is the upload for the VPS. If that is the case, you'll need an ingress for the download. The following page has an example: http://blog.stevedoria.net/20050906/ingress-policing-with-linux-and-tc