Forum Discussion
LillyM_9417
Altostratus
Dec 22, 2011IRULE - 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
}
4 Replies
- nitass
Employee
have you forgotten else between the first and second if statement?
e.g.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_9417
Altostratus
Thanks for your advice, I will try it now :) - LillyM_9417
Altostratus
it 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.
Colin
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
