Forum Discussion

californiaroll_'s avatar
californiaroll_
Icon for Nimbostratus rankNimbostratus
Aug 18, 2009

How 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

  • 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_86682's avatar
    spark_86682
    Historic F5 Account
    This 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.
  • 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