Forum Discussion
californiaroll_
Nimbostratus
Aug 18, 2009How does this work?
Hi all,
I am new to iRule and have just given a following script that my predecessor left.
I could not figure out how this works even though it is pretty short.
Please give me any hints or hopefully an answer.
Thank you
----------------------------------------------
if (client_addr == 0.0.0.0 netmask 0.0.0.1) {
use pool xxx-http-1
}
else {
use pool xxx-http-2
}
----------------------------------------------
5 Replies
- The_Bhattman
Nimbostratus
This looks more like a a version 4 Rule. iRules is v9 and v10.
How it works: if a requests comes into a Virtual address running this rule, it will check client address is within 0.0.0.0 and 0.0.0.1 (I am assuming that he was writing in wildcard netmask) then the request goes to pool named xxx-http-1 otherwise go to pool named xxx-http-2. Thus it ONLY has 2 choices. - spark_86682Historic F5 AccountThis is actually very clever. What it is doing is sending clients whose IPs have an even last octet to pool xxx-http-1, and those with odd last octets to pool xxx-http-2. It's a way of statelessly load-balancing between pools.
- The_Bhattman
Nimbostratus
You are right Sparks. How could I have not seen that. Way cool. - californiaroll_
Nimbostratus
I could understand how it works. Thank you guys!! - hoolio
Cirrostratus
It's a novel solution and should provide very quick "persistence" to the two pools, but it doesn't provide any kind of higher level functionality that you would get if you added all the members to the same pool and used a load balancing algorithm like least connections or observed to select the best pool member. In v9 or 10 it also doesn't offer any persistence within the two different pools (persistence was set at the pool level in 4.x so this wouldn't have been an issue).
I'd say you'd be better off changing the pool configuration to one pool, use persistence on the virtual server and a more advanced load balancing algorithm. You can read sections of the LTM config guide for your version to get details on the various load balancing and persistence options.
Aaron
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
