From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Arcus Date: Tue, 14 May 2013 17:38:23 +0000 Subject: Re: Limiting download from server Message-Id: <5192768F.9040000@open-t.co.uk> 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 On 14/05/13 16:15, Carlos Nepomuceno wrote: > Hi guys! This is my first post on this list. > > I'd like to ask for your advice on how to limit the download rate and total traffic from a server based on the IP of the client. > > I need to put some restrictions on particular clients that are overloading a server (CentOS 6). > > Any help will be very much appreciated. > You might want to start by reading some of the info at lartc.org. I'm afraid some of it is seriously out of date - but other bits are very much current. I started with the HTB script from this page: http://lartc.org/howto/lartc.cookbook.ultimate-tc.html#AEN2241 and then further adapted it to suit my needs. You will most likely need to use different classes for different client IP addresses - and set the rate (and maybe the "ceil") option as needed for each class - in order to only allow it as much bandwidth as you want it to have. If you need to add and remove IP addresses on the fly - you might need to "complicate" the script a bit further - but if your clients use static IP addresses - setting up few classes and filters for few clients shouldn't be too difficult. Hope the above helps