Forum Discussion
Gus_Thompson_11
Nimbostratus
Oct 29, 2007Cookie Persistence iRule help
Greetings,
I’m in desperate need of a solution for “Cookie Insert” persistence. I have worked with F5 support for over a month now, and still have not been able to resolve our issues. So, I’m reaching out to the true experts to see if iRules can do what we need. I’m very new to iRules, so please be as detailed as possible.
First let me explain the layout:
We have 4 Apache/Linux web servers that are load balanced behind a pair of active / active F5 BIG-IP 9.1.2 Build 40.2 Load Balancers.
We have created a pool (ST-AWtestsite-173) listening on all ports (*).
We have created a virtual server (ST-http-AWtestsite-173) listening for HTTP (port 80)
We have created a virtual server (ST-https-AWtestsite-173) listening for HTTPS (port 443)
We are using a single arm configuration for the F5.
F5-1 = 172.26.30.240
F5-2 = 172.26.30.241
www1 = 172.26.30.1
www2 = 172.26.30.2
www3 = 172.26.30.3
www4 = 172.26.30.4
Note: the webservers listen on port 80 and 443
We are using the default http profile.
We tried using Cookie Insert as our default persistence profile and Source Address Affinity as our fall back persistence profile.
We are not able to maintain persistence using these settings when a client goes from HTTP to HTTPS. F5 Support has told us that cookie insert does not allow for “match across services”, “match across virtual servers”, and “match across pools”. We also tried cookie hash, but that fails at times when the servers redirect the clients using 302 redirects.
If by using a Universal Persistence profile and an iRule, could we maintain persistence across services and virtual servers? We need to be sticky to the same web server for HTTP and HTTPS. If so, how would I build the iRule to insert a cookie and maintain persistence based on that cookie?
As an FYI, using source address affinity as the main persistence profile works for us, but does not work when multiple clients originate from the same source address (proxied client). Using cookie insert works great for that scenario but fails when switching services.
Thanks in advanced for your help,
Gus
- David_Homoney
Nimbostratus
It appears that the backend servers handle the decryption of the data stream and therefore no cookie insert will work. The issue is that if you are just passing through SSL and not having the BIGIP handle decryption you will not be able to insert a cookie or use anything other than source addr because you can't insert anything into encrypted headers. The answer we need is whether or not the BIGIP is handling SSL decryption or not. At that point we can determine if the aforementioned rule can help or not. - Gus_Thompson_11
Nimbostratus
Hey guys, - Gus_Thompson_11
Nimbostratus
Aaron,Verify target server exists as a pool member and is available to accept traffic if { [LB::status pool $poolName member $nodeIp $nodePort] eq "up" }{ set the pool to the value from the cookie pool $poolName member $nodeIp $nodePort if {$::debug}{ log local0. "setting pool to: pool $poolName member $nodeIp $nodePort" }
- dennypayne
Employee
What David is saying is that if your HTTPS virtual server points to a pool that has pool members using 443 as well, without any client and/or server side ssl profiles enabled, then cookie insert will never work regardless of whether "match across" is a factor or not. If that is the case, then BIG-IP is not doing any decryption and is passing SSL all the way to the webservers. It cannot insert any cookie into that stream. - dennypayne
Employee
EDIT: and I have not had issues with "match across" in a regular LTM environment using cookies, as long as it is set up as I described. That CR seems to only reference ASM? - Gus_Thompson_11
Nimbostratus
Hi Denny, - Gus_Thompson_11
Nimbostratus
Hi Denny, - hoolio
Cirrostratus
Posted By dennypayne on 10/29/2007 2:57 PM
- Gus_Thompson_11
Nimbostratus
Hey Guys,01070394:3: SSL::disable in rule (gus_test) requires an associated SERVERSSL or CLIENTSSL profile on the virtual server (ST_http_173-lbc.aw.amo.com)
- Deb_Allen_18Historic F5 AccountHi Gus --
if { [PROFILE::exists clientssl] == 1} { if {$::debug}{log local0. "Client SSL profile enabled on VIP. Disabling SSL"} SSL::disable clientside }
if { [PROFILE::exists clientssl] == 1 } { if {$::debug}{log local0. "Client SSL profile enabled on VIP. Disabling SSL"} set ssl_disable "SSL::disable clientside" [eval $ssl_disable] } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects