Forum Discussion
Javier_Fernand2
Nimbostratus
Jul 04, 2005set Persist iRule to match across virtual server
I want to configure an iRule to set the persistence for 2 virtual server by source address affinity, I want that if the client's IP begins with 195.53.125.1* always goes to the same server. The virtual server are in the same IP but different port (one of then is http and the another is https). I have tried to config this with the following irule:
when HTTP_REQUEST {
if { [IP::client_addr] starts_with "195.53.125.1" } {
persist source_addr
}
But it doesn't work, when the client goes to one virtual server the persistence works on this virtual server but when the clients goes to the other virtual server the persistence changes for it. In other words, the persistence iRule is working on each virtual server but it doesn't match across both virtual server. I don't know how I have to write the iRule to set the paramether "Match across Virtual Server".
Do you know how can I config it? Do you know how can I write the irule to Match the persistence acroos virtual server?
Thanks
- unRuleY_95363Historic F5 AccountYou simply need to configure a persist profile of type source address and check the "across virtuals" box. Then add this profile to the virtual server. It will act as the default. Then, when you don't want to persist based on source address, you'll need to invert your logic in your rule and execute a "persist none" statement. For example:
if { not ( [IP::client_addr] starts_with "195.53.125.1" ) } { persist none }
- Javier_Fernand2
Nimbostratus
Firstly thanks for your answer. - unRuleY_95363Historic F5 AccountThat's ok. You should still be able to handle it similarly. You will likely still want to create a source address persist profile with the "across virtuals" box checked and assign it to the virtual. Then you would use a rule more like this:
if { not ( [IP::client_addr] starts_with "195.53.125.1" ) } { persist cookie insert "MyCookieName" }
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