Forum Discussion
Assign a Pool regarding to the Destination Port.
Hi Aschi,
using ">30000 or <30050" will cause every single port to trigger, since port :1 would be lower than :30050 and port :65535 would be higher than 30000. The problem is caused by the "OR" operator which requires "at least one" of the expression to be "true" to trigger the desired action...
The right snipped for your task would make use of an "AND" operator...
if { ( [TCP::local_port] > 30000 ) and ( [TCP::local_port] < 30050 ) } then {
pool poola
} elseif { [TCP::local_port] == 22 } then {
pool poolb
} else {
drop
}
By doing so, the port must be above :30000 AND below :30050 to trigger the desired action. Furthermore "elseif" is your friend to chain several independent expressions in a single "If" command.
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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