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...
leonline_225556
Altostratus
Jun 07, 2018Hi LeaV97,
Using the regexp argument with the switch command you can easily match on numeric ranges. The following iRule will probably help you.
when CLIENT_ACCEPTED
{
switch -regexp [TCP::local_port]
{
[10000-10024] { pool pool-site1 }
[10025-10049] { pool pool-site2 }
[10050-10074] { pool pool-site3 }
default { pool default_pool }
}
}
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