Forum Discussion
Gavster78_13032
Nimbostratus
Mar 04, 2014Persist iRule based on source address
Hi
Hopefully this is an easy question. I have a HTTPS VIP with two pool members and four possible sources (A,B,C,D). I need to create an irule that uses a persist timeout of say 30 seconds whe...
Kevin_Stewart
Employee
Mar 04, 2014Here is perhaps one way to do this: create a Universal persistence profile, apply the following iRule, and set Timeout to Indefinite. Then apply this persistence profile to your virtual server:
when CLIENT_ACCEPTED {
if { [persist lookup source_addr [IP::client_addr]] ne "" } {
persist source_addr [IP::client_addr]
}
}
when SERVER_CONNECTED {
if { [persist lookup source_addr [IP::client_addr]] equals "" } {
switch [IP::client_addr] {
"10.80.0.1" { persist add source_addr [IP::client_addr] 30 }
"10.80.0.2" { persist add source_addr [IP::client_addr] 30 }
"10.70.0.1" { persist add source_addr [IP::client_addr] 1800 }
"10.70.0.2" { persist add source_addr [IP::client_addr] 1800 }
}
}
}
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