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, 2010Hoolio wrote something up for SNATing based on the 3rd Octet...that logic could easily be ported over...if I find time today, I'll try writing something up
http://devcentral.f5.com/Forums/tabid/1082223/asg/52/showtab/groupforums/afv/topic/aff/31/aft/813179/Default.aspx
when CLIENT_ACCEPTED {
Use a local array to configure the 5 SNAT addresses
set snat_ips(0) 1.1.1.1
set snat_ips(1) 2.2.2.2
set snat_ips(2) 3.3.3.3
set snat_ips(3) 4.4.4.4
set snat_ips(4) 5.5.5.5
Use getfield to parse the third octet from the client IP address
Get the modulus of the third octet against the number of the SNAT IPs in the array
set snat_number [expr {[getfield [IP::client_addr] "." 3] % [array size snat_ips]}]
log local0. "Client IP: [IP::client_addr], SNAT number $snat_number, SNAT IP: $snat_ips($snat_number)"
Apply the SNAT
snat $snat_ips($snat_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
