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...
The_Bhattman
Nimbostratus
Sep 02, 2010Hi Dan,
I would avoid using regex. Another method is to use lindex and split tcl commands
when CLIENT_ACCEPTED {
set ip4 [lindex [split [IP::client_addr] "."] 3]
if { ($ip4 >= 0) and ($ip4 < 65) } {
pool pool_1
} else if { ($ip4 >= 65) and ($ip4 < 129) } {
pool pool_2
} else if { ($ip4 >= 129) and ($ip4 < 193) } {
pool pool_3
} else if { ($ip4 >= 193) and ($ip4 < 256) } {
pool pool_4
}
}
This is untested of course
I hope this helps
Bhattman
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
