Forum Discussion
danielng_19608
Nimbostratus
Feb 17, 2010Need help with Load Balancing iRule
Hi all, i have been working on this iRule to load balance traffic based on source ip addresses. Basically i wish to balance source traffic by throwing them to 2 of the proxy servers based on source ip addresses. i have came up with something listed below:
when CLIENT_ACCEPTED {
if { [IP::addr 10.0.0.1/32 equals 10.0.0.0/24] } {
pool Cache_Pool_HTTP member 5.5.5.5 80
}
else {
pool Cache_Pool_HTTP member 5.5.5.6 80
}
}
please advise if i am missing anything out here?
3 Replies
- hoolio
Cirrostratus
Hi Daniel,
If you change the IP::addr command to check the client IP address it should work fine to check if the client IP is in the 10.0.0.0/24 network:
if { [IP::addr [IP::client_addr] equals 10.0.0.0/24] } {
Aaron - hoolio
Cirrostratus
Or are you trying to alternate between the two pool members based on the last octet of the client IP? If so, this might be relevant:
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=61264
Check if client IP address is odd or even
if { [IP::addr [IP::client_addr] equals 0.0.0.0/1] } {
Aaron - danielng_19608
Nimbostratus
thanks alot for the input hoolio, what i was trying to achieve was to alternate between pool members based on ip subnets. your first input really helped! thanks again
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
