# Limit downlaod speed per ip

**URL:** <https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347>\
**Category:** NGINX\
**Created:** [January 24, 2013, 6:52pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347 "2013-01-24T18:52:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 24, 2013, 6:52pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/1 "2013-01-24T18:52:51Z")

</div>

Hello,

```
   Is there a way to limit speed per ip ? Doesn't matter how many

```

connections the single ip is consuming but he shouldn’t be able to get  
more  
than assigned download limit.

limit\_rate directive is for per connection but not for per ip.

Looking forward to your help. Thanks

---

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 24, 2013, 6:59pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/2 "2013-01-24T18:59:53Z")

</div>

On 01/24/2013 06:52 PM, shahzaib shahzaib wrote:

> Hello,
> 
> ```
> Is there a way to limit speed per ip ? Doesn't matter how many
> 
> ```
> 
> connections the single ip is consuming but he shouldn’t be able to get more  
> than assigned download limit.
> 
> limit\_rate directive is for per connection but not for per ip.
> 
> Looking forward to your help. Thanks

You need to do it on system level, like tc on linux or ipfw on freebsd  
and so on.

– Piotr.

---

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 24, 2013, 7:03pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/3 "2013-01-24T19:03:24Z")

</div>

Can you explain a bit ? We are using Centos 6.3.

---

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 24, 2013, 8:12pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/4 "2013-01-24T20:12:22Z")

</div>

On 01/24/2013 07:02 PM, shahzaib shahzaib wrote:

> Can you explain a bit ? We are using Centos 6.3.

$ man tc

> **[Traffic Control HOWTO](http://linux-ip.net/articles/Traffic-Control-HOWTO/)**
>
> Traffic control encompasses the sets of mechanisms and operations by
> which packets are queued for transmission/reception on a network
> interface. The operations include enqueuing, policing, classifying,
> scheduling,...

Regards,  
Patrick

---

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 25, 2013, 5:05pm UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/5 "2013-01-25T17:05:40Z")

</div>

Thanks guyz, i’ll look into your module, if it works for me and will let  
you know about that 🙂

---

<div class="post-metadata">

**Author:** ![shahzaib12](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90db22/32.png) [@shahzaib12](https://www.ruby-forum.com/u/shahzaib12)\
**Post date:** [January 25, 2013, 4:40am UTC](https://www.ruby-forum.com/t/limit-downlaod-speed-per-ip/229347/6 "2013-01-25T04:40:47Z")

</div>

I used to write a simple module for such purpose, It should work. Have a  
try: [GitHub - yaoweibin/nginx\_limit\_speed\_module: limit the total speed from the specific user](https://github.com/yaoweibin/nginx_limit_speed_module)

2013/1/25 Patrick L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
