Forum Discussion
TMcGov_92811
Nimbostratus
Jan 21, 2009IRule to use Pool depending on Client source address
I need to add some more logic to an existing iRule, and I think I need to clean it up before doing so. I'm sure there must be a better way for me to do this. Basically, I just want to examine the clie...
dennypayne
Employee
Jan 21, 2009Hi,
You'll want to use the matchclass command with a couple of class files (Data Groups in the GUI). Click here
So if you build 2 class files, one called http-Test-mediation and the other alt-http-Test with the appropriate addresses, then use a rule like this:
when CLIENT_ACCEPTED {
if { [matchclass $::http-Test-mediation contains [IP::client_addr]] } {
pool http-Test-mediation
} elseif { [matchclass $::alt-http-Test contains [IP::client_addr]] } {
pool alt-http-Test
} else {
pool alt-http-Test-mediation
}
}
then you should be able to update your class files without having to change the rule.
Denny
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