Forum Discussion
ibehavior_37902
Nimbostratus
Aug 31, 2010Load balance on source ip address
Hello -
I need to be able to load balance incoming traffic to one of 4 back end pools based on some part of the source IP address. I have found several examples of how to do this at the su...
Chris_Miller
Altostratus
Sep 01, 2010Quick mod....test it out and see whether it works for you...I pretty much just did find and replace so I very well may have missed something.
when HTTP_REQUEST {
Use a local array to configure the 4 pools
set pool_choice(0) pool_1
set pool_choice(1) pool_2
set pool_choice(2) pool_3
set pool_choice(3) pool_4
Use getfield to parse the third octet from the client IP address
Get the modulus of the third octet against the pool members in the array
set pool_number [expr {[getfield [IP::client_addr] "." 3] % [array size pool_choice]}]
log local0. "Client IP: [IP::client_addr], Pool number $pool_number, Pool Choice: $pool_choice($pool_choice)"
choose a pool
pool $pool_choice($pool_number)
}
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
