Forum Discussion
Jeff_46763
Nimbostratus
May 16, 2016Irule to Load Balance traffic based on group of IP's
I would like to write an Irule to basically say "if a group of IP's come into the VIP, load balance to server 1 and 2, all others hit server 3" I'm newish to Irules so would like some help please. ...
Yann_Desmarest
Cirrus
May 16, 2016Hello,
You can use list directly in the irule as shown in the example below :
when RULE_INIT {
set static::ipaddress ["10.1.1.1" "10.1.1.2" "10.1.1.3"]
}
when HTTP_REQUEST {
if { [lsearch -glob $static::ipaddress "[IP::client_addr]"] != -1 } {
pool mypool
} else {
pool default_pool
}
}
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