Forum Discussion
Kmussa_164917
Nimbostratus
Nov 01, 2014Load balance based on the source IP addresses 4th octet
Hello,
I’m attempting to create an iRule that will load balance based on the source IP addresses 4th octet and based on the availability of pool members. If it’s odd, I want it to redirect to http:/...
R_Marc
Nimbostratus
Nov 02, 2014there are more odds than 3,5, 7 and 9.
To detect if something is even or odd you should use modulus.
pseudo code: if { $X%2 } { odd } else { even }
For example:
cat test.tcl
if { 1025%2 } { puts "odd" } else { puts "even" }
if { 666%2 } { puts "odd" } else { puts "even" }
tclsh test.tcl
odd
evenHelp guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
