Forum Discussion

JAK's avatar
JAK
Icon for Nimbostratus rankNimbostratus
Mar 23, 2017

LB members within a redirect iRule

Have a working iRule to redirect a specific source IP to a specific pool member. Now want to add load balancing between 3 pool members within that pool via the iRule.

 

I know a redirect between many pools would allow for the LB method of the pool to handle this, but we want to use one pool, since we will have many redirects.

 

Current iRule (12.1.1 HF1 code)

 

when CLIENT_ACCEPTED {
set client [IP::client_addr]
    if {$client equals "1.1.1.1" } {
    pool my-pool member 10.10.10.10 1025
    }
    elseif {$client equals "2.2.2.2" } {
    pool my-pool member 10.10.10.10 2025
    }
    else {
    pool my-pool member 10.10.10.10 25
    }
}

1 Reply

  • As a rule of thumb, a pool should contain pool members using the same port. For example: POOL_1025 has pool members that listen on port 1025 and POOL_2025 has pool members that listen on port 2025 etc. This will help in troubleshooting and helps you to scale the configuration over time.

     

    Having said that your iRule looks reasonable for what you are trying to achieve.