Forum Discussion
LeaV97_339056
Nimbostratus
Jun 07, 2018iRule with switch
I have an application that needs to be routed based on the incoming port . They have 5 different pools each with 25 ports. I'm thinking 1 VS with all ports open and then using an iRule to control t...
Stanislas_Piro2
Cumulonimbus
Jun 08, 2018you can also use this:
set port [TCP::local_port]
switch 1 \
[expr {$port>=10000 && $port<10025}] {pool pool-site1} \
[expr {$port>=10025 && $port<10050}] {pool pool-site2} \
[expr {$port>=10050 && $port<10075}] {pool pool-site3} \
default {pool default_pool}
Make sure you let 1 in switch value, each expression is evaluated and the result is compared with 1 until one success.
This switch command can't have curly brackets because of expression evaluation, that's why the \ is mandatory at the end of each line but the last.
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