Hi,
You can use 'or' or || in TCL, but you'd need to have each condition listed fully. Also, if you're wanting to restrict which ports the virtual server accepts traffic on, you should use TCP::local_port in the clientside context (
Click here). For your scenario, using a switch would be cleaner than a set of if's (
Click here). Here are two versions:
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
}
}
}
Aaron