Forum Discussion
LillyM_9417
Dec 22, 2011Altostratus
IRULE - IP::client_addr
Hello,
I want to ask a question about "IP::client_addr". I write the following irule:
When client has the X.X.X.3 ip address, it goes to the first "if" thats okey and I see from the ltm log ( I opened a debug..) , but the connection is not forwarded to the Pool x it is forwarded to the default Pool, I also see from the log file that the same connection is also forwarded to the default pool. How can it be possible? What is wrong in this irule?
if { [IP::addr [IP::client_addr] equals x.x.x.0/24]}{
pool X
}
if { [IP::addr [IP::client_addr] equals y.y.y.0/24]}{
pool Y
}
else {
default pool
}
- nitassEmployeehave you forgotten else between the first and second if statement?
if {[IP::addr [IP::client_addr] equals x.x.x.0/24]} { pool X } elseif {[IP::addr [IP::client_addr] equals y.y.y.0/24]} { pool Y } else { pool default }
- LillyM_9417AltostratusThanks for your advice, I will try it now :)
- LillyM_9417Altostratusit works, you are great!
- Colin_Walker_12Historic F5 AccountThis is an excellent example of the way that the pool command actually works in an iRule. It's effectively updating a pointer that is used to route traffic. I think this one deserves a Tech Tip, adding it to my list for the iRules Concepts series to do some more digging on.
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