cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2335
Views
0
Helpful
4
Replies

Sticky using X-Forwarded-For

stevens_jj
Level 1
Level 1

Hello,

  I have a back-end ACE which needs to create a sticky based on a header value. The  X-Forwarded-For header is perfect as it indicates the original client ip.  There is a front end ACE which is setting the header correctly.

  My goal is to have the sticky associate every subsequent request originating from the same client ip (X-Forwarded-For value) to go to the same backend server.  This application opens multiple sessions and they all need to go to the same backend server.

  Does anyone have an example of what that backend ACE config would look like?

4 Replies 4

Daniel Arrondo Ostiz
Cisco Employee
Cisco Employee

Hi Joseph,

You have all the documentation regarding header stickiness, along with some examples at the following link:

http://www.cisco.com/en/US/docs/interfaces_modules/services_modules/ace/vA2_3_0/configuration/slb/guide/sticky.html#wp1060063

I hope this helps

Daniel

I've got it setup and its reading the header however, it appears sometimes the header contains the client IP twice and sometime its only once.

My client initiates 2 sessions and I am getting 2 sticky entries for the same client instead of 1.  The "show sticky database http-header 10.24.28.176" shows 1 entry and "show sticky database http-header 10.24.28.176, 10.24.28.176" shows a second entry which gets sent to a different rserver.

I tried to use a header offset/length but this has problems since the ip address can change in length depending on if the octets are populated.

I changed up the config to create a custom header called "SRCIP" and put the %is in it.  Now I am getting just teh single address in each session.  It works for a little bit then eventually the client gets sent to a different server which fails the app.

Hi Joseph,

If I understood you correctly, you now configured the ACE to insert a header with the client IP in it. Am I right? If so, this is not going to work

For stickiness to work properly, you would need to ensure that the client (or the proxy before the ACE) is inserting a string on the request that remains constant throughout all the connections from a single client. The moment this string changes, the ACE will no longer be able to find a valid sticky entry and just send the request to another server.

If the header stickiness is not working properly due to the changing headers, you could always try using cookie stickiness instead. The ACE can insert a cookie for stickiness purposes, and there is no reason for the client to modify it.

Daniel

Review Cisco Networking for a $25 gift card