Forum Discussion
THASIN
May 02, 2012Nimbostratus
http to https cookie persistence
Hi ALL, Creating persistence record based on IP address using custom made irule as specified in the link below, Is there any randomness or variance or uniqueness in the persistence record. i...
hooleylist
May 02, 2012Cirrostratus
Hi Thasin,
As the cookie value is just used to persist clients to the same pool member, you actually want it to be specific to the pool member, not the client session. This is more efficient for TMM as there are fewer records to store in memory.
Here's an updated version of the Codeshare iRule which uses a lighterweight CRC32 checksum.
If you're on 11.x you can use this version:
rule cookie_persist_http_plus_s {
Check if there is a cookie and use persistence table
if the entry does not exist, loadbalance and create record
when HTTP_REQUEST {
if { [HTTP::cookie value "bIPs"] ne "" } {
persist uie [HTTP::cookie value "bIPs"]
set need_cookie 0
} else {
set need_cookie 1
}
}
when PERSIST_DOWN {
This event will only work in 11.0+.
Ask F5 Support for details on BZ225436 for details.
Server that UIE peristence pointed to was down
set need_cookie 1
}
Calculate CRC32 checksum of the server's IP
and store it as a cookie and create persistence record
when HTTP_RESPONSE {
if { $need_cookie } {
HTTP::cookie insert name "bIPs" value [crc32 [IP::server_addr]] path "/"
persist add uie [HTTP::cookie value "bIPs"]
}
}
}
v10.x version which sets the cookie on every response
rule cookie_persist_http_plus_s {
Check if there is a cookie and use persistence table
if the entry does not exist, loadbalance and create record
when HTTP_REQUEST {
if { [HTTP::cookie value "bIPs"] ne "" } {
persist uie [HTTP::cookie value "bIPs"]
}
}
Calculate CRC32 checksum of the server's IP
and store it as a cookie and create persistence record
when HTTP_RESPONSE {
HTTP::cookie insert name "bIPs" value [crc32 [IP::server_addr]] path "/"
persist add uie [HTTP::cookie value "bIPs"]
}
}
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