Forum Discussion
Select Node based on a previous LB selection
Hi DevCentral,
I would like to ask your opinion/suggestion regarding the following requirement regarding an LTM/APM based scenario:
Scenario: I have an AAA - HTTP Server(APM) configured that points to http://10.10.10.10 which is my Virtual server that load balances the HTTP Custom Post request to two different servers(poolX). If the user is successfully authenticated the backend respond with a JSESSIONID cookie that is sent back to the client. The pool where the HTTP Post is sent is the same pool configured on the VS with the Access policy associated. So the problem is the following: BIG-IP send the Custom HTTP Post to the AAA HTTP Server (VS with poolX associated) after that the client need to be balanced to the same server selected during the Custom HTTP Post generated by BIG-IP, otherwise the client could be balanced on the server that does not have the "authenticated session".
Thanks in advance,
M.
- riraccuiaCirrus
According to your description everything seems to be happening on the same VS so I'm thinking you just need to persist your node selection by configuring a (cookie) persistence profile: https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-concepts-11-4-0/10.html
- Stanislas_Piro2Cumulonimbus
Hi,
In your VS 10.10.10.10 and APM-protected VS, you must configure universal persistence with JSESSIONID. both VS may use the same pool.
After authentication, extract JSESSIONID cookie from HTTP Auth response (VPE / Variable Assign):
session.custom.jsessionid = expr { [lindex [regexp -inline {JSESSIONID=([^;\\\r]*)} [mcget session.http.last.response_cookie]] 1] }
Enable this irule on APM-protected VS to insert JSESSIONID in response after authentication:
when ACCESS_POLICY_COMPLETED { if { ([ACCESS::policy result] equals "allow")} { set jsessionid [ACCESS::session data get session.custom.jsessionid] ACCESS::session data set session.user.sessiontype "ltm_apm" ACCESS::respond 302 noserver Set-Cookie "JSESSIONID=$jsessionid;path=/;HttpOnly;secure" Location [ACCESS::session data get session.server.landinguri] } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com