Forum Discussion
Zuke_254875
Altostratus
Apr 03, 2019Port range iRule
We have a requirement for a wildcard virtual server and to allow access to the application servers on port range between 30000 and 32768.
When I apply the below iRule, I'm unable to reach the serve...
Kai_Wilke
MVP
Apr 03, 2019Hi Zuke,
the
if
command has a build inmplicit expression. No need for the explicit [expr]
command.
when CLIENT_ACCEPTED {
if { ( [TCP::client_port] < 30000 ) or ( [TCP::client_port] > 32768 ) } then {
reject
}
}
Just for learning purposes the iRules below will work too. But they are more complex and also slower, since you basically pipe the output of the explicit
[expr]
command (0 or 1) to the implicit expression of the if
command...
when CLIENT_ACCEPTED {
if { [expr { [TCP::client_port] < 30000 }] or [expr { [TCP::client_port] > 32768 }]} then {
reject
}
}
when CLIENT_ACCEPTED {
if { [expr { ( [TCP::client_port] < 30000 ) or ( [TCP::client_port] > 32768 ) }] } then {
reject
}
}
Cheers, Kai
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