Forum Discussion
Mario_Eury_6049
Nimbostratus
Dec 18, 2006Switch Command
I'm trying to use the "switch" syntac command to load balance traffic based on a client's subnet/network address. I have a list of subnets that would need to be listed to load balance to the test_pool...
hoolio
Cirrostratus
Dec 18, 2006I don't think you can do comparisons within the switch conditions. You could try using an if/elseif/elseif/else format:
when CLIENT_ACCEPTED {
set IPADDR [IP::remote_addr]
if { [IP::addr $IPADDR equals 192.168.100.0/26] }{
pool test_pool
}
elseif { [IP::addr $IPADDR equals 10.10.0.0/16] }{
pool condition2_pool
}
else {
pool default_pool
}
}Aaron
Help 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