Forum Discussion
Burrell
Nimbostratus
Feb 18, 2016Help with iRule Port Switch statement
I have an application with 2 nodes running 4 discrete services across a group of 4 pool ranges.
I have configured a FastL4 vs with port 0 and use an iRule switch to match the port and select the c...
Kai_Wilke
MVP
Feb 18, 2016Hi Burrell,
its kinda complicated to match port-ranges using the
[switch] command, so you may try a [if] based sytax as outlined below...
when CLIENT_ACCEPTED {
if { ( [TCP::local_port] >= 26000 ) and ( [TCP::local_port] <= 26009 ) } then {
pool RTS_PROD_pool1
} elseif { ( [TCP::local_port] >= 26500 ) and ( [TCP::local_port] <= 26509 ) } then {
pool RTS_PROD_pool2
} elseif { ( [TCP::local_port] >= 27000 ) and ( [TCP::local_port] <= 27009 ) } then {
pool RTS_PROD_pool3
} elseif { ( [TCP::local_port] >= 27500 ) and ( [TCP::local_port] <= 27509 ) } then {
pool RTS_PROD_pool4
} else {
reject
}
}
Cheers, Kai
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
