Forum Discussion
Persist 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 when the source is A&B and a timeout of 1800 seconds when the source is C&D? in other words a different timeout for the same VIP based on the source address?
Thanks in advance
Gavster78
1 Reply
- Kevin_Stewart
Employee
Here 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
* 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