Forum Discussion
Frank_J_104756
Sep 24, 2007Historic F5 Account
irule feature question
Site has multiple VS, A, B, C, D...user 1 comes in and gets directed to VS A. VS A has coookie insert persistence. User gets a cookie. Something on the user side (AOL proxy) changes and user then gets directed to VS B. Can an irule be written and applied to VS A, B, C, and D that would recognize an F5 created cookie in the HTTP stream, and redirect the client back to the VS that originated the cookie ?
This is an ecommerce site and what is happening is costing a lot in money and customer satisfaction since the shopping cart doesn't stay populated.
Thanks!
- Deb_Allen_18Historic F5 AccountYou can also change the mask for LDNS persistence on GTM to /16, and that should keep the mega proxies from bouncing around. Of course YMMV, since all other LDNS are subject to the same grouping.
class xPoolname2VSName { PoolA serverA.domain.com PoolB serverB.domain.com PoolC serverC.domain.com }
when HTTP_REQUEST { set CookiePool [findstr [HTTP::cookie names] "BIGipServer" 11 " "] if { $CookiePool !=""}{ set clength [HTTP::header Content-Length] if { [HTTP::header Content-Length] > 1048576 set clength [HTTP::header Content-Length] } else { set clength 1048576 } set uri [HTTP::uri] HTTP::collect $clength } } when LB_SELECTED if { $CookiePool != "" && \ $CookiePool != [LB::server pool]}{ set VSName [findclass $CookiePool $::xPoolname2VSName " "] if $VSName != ""}{ HTTP::redirect "http://$VSName/$uri } } else { HTTP::release } [
- JRahm
Admin
where is that mask setting on GTM LDNS persistence? - Frank_J_104756Historic F5 Accountdeb, I'll be keying off of cookies issued by LTM. There's a need to possible redirect to VS on another LTM. That would remove pool name as a tool for me to use. How would that change your rule. can I just look for cookie name, and redirect accordingly ?
- Deb_Allen_18Historic F5 AccountThat's pretty much what that rule does, and will still work as long as the pools have unique names across both LTMs.
The value is the number of bits in the persistence mask.System / General Properties / Global Traffic / General / Static Persist CIDR (IPv4) or System / General Properties / Global Traffic / General / Static Persist CIDR (IPv6)
- Frank_J_104756Historic F5 AccountOK dumb question then...since I know what the cookie names will be, will
if { [HTTP::cookie exists "Cookie name"]
when HTTP_REQUEST { set CookiePool [findstr [HTTP::cookie names] "BIGipServer" 11 " "] if { $CookiePool !=""}{ set clength [HTTP::header Content-Length] if { [HTTP::header Content-Length] > 1048576 set clength [HTTP::header Content-Length] } else { set clength 1048576 } set uri [HTTP::uri] HTTP::collect $clength } }
- Deb_Allen_18Historic F5 AccountIn that example, you still would need to collect & hold the connection until a decision can be made as to its disposition.
and then use some condition to determine the appropriate redirect. There are 2 very helpful hooks in the approach I mentioned:class xPoolname2VSIP { SiteACookieName 192.168.1.1 SiteBCookieName 192.168.2.1 }
class xCookieValue2VSIP { SiteACookieValue 192.168.1.1 SiteBCookieValue 192.168.2.1 }
when HTTP_REQUEST { set VSCookie [HTTP::cookie VSCookie] if { $VSCookie != ""}{ set VSIP [findclass $VSCookie $::xCookieValue2VSIP " "] compare local VS IP to the one corresponding to that cookie value & redirect if they dont' match if {$VSIP != [IP::local_addr]}{ HTTP::redirect "http://$VSIP[HTTP::uri]" } } }
- Frank_J_104756Historic F5 AccountI"m starting to see that my initial approach was a bit too simple then...What I'm going do to is make sure that each of the geographically distributed stand-alone LTM's have "all" pools...both the one's local to it and the pools local to the other...from what you're saying my idea of
- johns
Employee
There is a Static Persist CIDR setting under, "System -> Global Traffic -> General", but I do not believe there is a setting for this for Dynamic Persistence on GTM. This was one of the things that did not make during 3-DNS to GTM transition. - Frank_J_104756Historic F5 AccountDeb, you are absolutely correct. What I'm ending up with is 2 session cookies. The 1 from the original VS1A that I'm using to select the appropriate pool, plus the cookie from VS2A that I got when the new DNS A record sent me there.
- Deb_Allen_18Historic F5 AccountOK, then...
/debwhen HTTP_REQUEST { set CookiePool [findstr [HTTP::cookie names] "BIGipServer" 11 " "] if { $CookiePool !=""}{ pool $CookiePool } }
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