Forum Discussion
Nov 17, 2010
matchclass, uri routing, and cookie persist & snat irule
Hey guys and gals, it's been a bit, I hope all is well.
Please review the below scenerio and let me know if i'm missing something, or if you would do anything differently..
I worked up the b...
hooleylist
Jan 27, 2012Cirrostratus
Hi Brian,
You could just use the default cookie insert persistence profile for this and leave out all of the persistence in the iRule. LTM will then set a persistence cookie for each pool the client is sent to.
Else, if you want to do this manually, you should add a check to see if the cookie value is not null before persisting on it. Persisting on a null string will (or should) cause a run time error and TCP reset. Also, you'd want to add the persistence in the response when the app sets the cookies:
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/unica*" {
set cookie_name "UMPSESSIONID"
pool Unica_Platform_Test
}
"/plan*" {
set cookie_name "PLANJSESSIONID"
pool Unica_Plan_Test
}
"/campaign" {
set cookie_name "CAMPAIGNSESSIONID"
pool Unica_Campaign_Test
}
"/dashboard* {
set cookie_name "JSESSIONID"
pool Unica_Campaign_Test
}
default {
set cookie_name "UMPSESSIONID"
pool Unica_Platform_Test
}
}
if {[HTTP::cookie $cookie_name] ne ""}{
persist uie [string tolower [HTTP::cookie $cookie_name]] 3600
}
}
when HTTP_RESPONSE {
if {[HTTP::cookie $cookie_name] ne ""}{
persist add uie [string tolower [HTTP::cookie $cookie_name]] 3600
}
}
And also on that page is a note from Aaron (hoolio), indicating that we need to use OneConnect for that iRule to work? We've been using that persistence iRule for some time now and don't have OneConnect enabled for that VS. Could this be causing odd connection issues, and should I look at enabling it for this rule too?
I'd definitely suggest using OneConnect with this iRule or with any other L7 persistence like cookie insert. If you’re using SNAT, you can use the default OneConnect profile with a /0 source mask. With no SNAT you should create a custom OneConnect profile with a /32 source mask.
For details on OneConnect, see this article:
http://devcentral.f5.com/wiki/AdvDesignConfig.ONECONNECT.ashx
Aaron
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