Forum Discussion
persist for all but one IP address
Hi,
We have an iRule for persistence, where we want to skip running the persistence logic for a specific IP-address. The rule works great, but for the one thing that the IP-address check fails. Is something wrong with the snippet below?
if { ![IP::addr [IP::client_addr] equals 131.206.24.6] } {
persist uie $persist_key 30
}
As described above, the "persist" statement is always executed. I have checked that the ip address is really the same address I am sending requests from - so I am guessing that it is something I am missing with the IP::addr comparison logic. What could be wrong?
3 Replies
- What_Lies_Bene1
Cirrostratus
Perhaps some brackets;
if { !([IP::addr [IP::client_addr] equals 131.206.24.6]) } { persist uie $persist_key 30 }Better yet (maybe);
if { [IP::addr [IP::client_addr] equals 131.206.24.6] } { return } persist uie $persist_key 30 - Daniel_02_13867
Nimbostratus
It seems to be that I did not specify any mask. I ended up generating some debut output and then performing string comparison, as I find it easier to reason about. So:
if { ![string equal [IP::client_addr] 131.206.24.6%1] } { persist uie $persist_key 30 } - What_Lies_Bene1
Cirrostratus
Ah, so you're using Route Domains?
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