# Ip\_hash clarification

**URL:** <https://www.ruby-forum.com/t/ip-hash-clarification/184149>\
**Category:** NGINX\
**Created:** [February 25, 2010, 6:40pm UTC](https://www.ruby-forum.com/t/ip-hash-clarification/184149 "2010-02-25T18:40:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2010, 6:40pm UTC](https://www.ruby-forum.com/t/ip-hash-clarification/184149/1 "2010-02-25T18:40:44Z")

</div>

Hi,

i need details regarding ip\_hash…

if i have client IP1: 192.168.1.1 and client IP2: 192.168.1.2

and I have 2 servers on the upstream… s1 and s1… with IP\_Hash  
configured

if client IP1 accesses the site it will go to lets say S1 would it  
actually  
mean that the next request coming from a new client IP Client2… will it  
go  
to s2?

finally how do they compute where to throw the request…

tia,

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2010, 7:58pm UTC](https://www.ruby-forum.com/t/ip-hash-clarification/184149/2 "2010-02-25T19:58:03Z")

</div>

On Thu, Feb 25, 2010 at 11:40 AM, J M [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> mean that the next request coming from a new client IP Client2.. will it go  
> to s2?

I believe ip\_hash uses only the “Class C” part of the address. This is  
so people with firewalls that have them “hop” IP addressess still get  
directed to the same back-end. So since both clients are coming from  
192.168.1.XXX, nginx will direct them to the same back-end server.

I was actually considering a patch to make this configurable a few  
moths ago, but we decided to go with session replication on our  
back-ends instead, so I stopped looking into it.

For testing, you could put a client on 192.168.2.XXX to see the  
desired behavior.

–  
RPM
