Forum Discussion
cory_seaborn_17
Nimbostratus
May 07, 2015Cookie persistence via iRule
I've read a few articles about accomplishing this but nothing that has really suited my needs so far.
At a high level, we have a 'shared' vserver that we use for multiple services. We load balance ...
nitass
Employee
May 16, 2015this is what i understand Steven meant.
configuration
[root@ve11c:Active:In Sync] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
persist {
cookie {
default no
}
source_addr {
default yes
}
}
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 13
}
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/test/" } {
persist cookie
} else {
Use source address persistence by default
}
}
}
source address persistence
[root@ve11c:Active:In Sync] config date; tmsh delete ltm persistence persist-records
Sat May 16 16:30:22 SGT 2015
[root@ve11c:Active:In Sync] config date; curl -I http://172.28.24.10/
Sat May 16 16:30:25 SGT 2015
HTTP/1.1 200 OK
Date: Sat, 16 May 2015 08:11:08 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT
ETag: "41879c-59-2a9c23c0"
Accept-Ranges: bytes
Content-Length: 89
Content-Type: text/html; charset=UTF-8
[root@ve11c:Active:In Sync] config date; tmsh show ltm persistence persist-records all-properties
Sat May 16 16:30:29 SGT 2015
Sys::Persistent Connections
source-address - 172.28.24.10:80 - 200.200.200.101:80
-----------------------------------------------------
TMM 0
Mode source-address
Value 172.28.24.13
Age (sec.) 5
Virtual Name /Common/bar
Virtual Addr 172.28.24.10:80
Node Addr 200.200.200.101:80
Pool Name /Common/foo
Client Addr 172.28.24.13
Owner entry
Total records returned: 1
cookie persistence
[root@ve11c:Active:In Sync] config date; tmsh delete ltm persistence persist-records
Sat May 16 16:30:46 SGT 2015
[root@ve11c:Active:In Sync] config date; curl -I http://172.28.24.10/test/
Sat May 16 16:30:52 SGT 2015
HTTP/1.1 200 OK
Date: Sat, 16 May 2015 08:13:30 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Mon, 17 Jun 2013 18:14:47 GMT
ETag: "420027-4b-925773c0"
Accept-Ranges: bytes
Content-Length: 75
Content-Type: text/html; charset=UTF-8
Set-Cookie: BIGipServerfoo=1875429576.20480.0000; path=/
[root@ve11c:Active:In Sync] config date; tmsh show ltm persistence persist-records all-properties
Sat May 16 16:30:55 SGT 2015
Sys::Persistent Connections
Total records returned: 0
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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