Forum Discussion
Perry_B__8260
Nimbostratus
Nov 28, 2007Logical Operator or Pipebar?
Hi -- I want to listen on VIP for TCP::client_port (445,1051,1052,10521) and direct to a Pool. Would it be required to use OR and braces for each eq statement -- or is this possible --
iRule my_iRule {
when CLIENT_ACCEPTED
if { [TCP::client_port] eq 445 || eq 1051 || eq 1052 || eq 10521 } {
pool my_POOL
}
else {
TCP::close
}
}
Thank you...
- hoolio
Cirrostratus
Hi,when CLIENT_ACCEPTED { if { [TCP::local_port] eq 445 || [TCP::local_port] eq 1051 || [TCP::local_port] eq 1052 || [TCP::local_port] eq 10521 } { pool my_POOL } else { TCP::close } }
when CLIENT_ACCEPTED { switch [TCP::local_port] { 445 - 1051 - 1052 - 10521 { log local0. "allowed [IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]" pool my_pool } default { log local0. "dropped [IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port]" drop } } }
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