Forum Discussion
Arnor_Arnason
Jul 13, 2011Altostratus
TCL error: invalid command name "1" on GTM
Hi, I have the following irule on my GTM: when DNS_REQUEST { if { [[active_members Global-webservices.landsbanki.is_A10_pool] = 0] and [[active_members Global-webservi...
hooleylist
Jul 13, 2011Cirrostratus
Hi Arnor,
The square braces execute the text within as a command and return the value. So if you have [$command1] or [$command2] it will return true or false (0 or 1). If you have [[$command1] or [$command2]] it will try to execute 0 or 1 and return an invalid command error as 0 and 1 aren't valid commands. If you want to do logical grouping, use parentheses instead.
Also, when using the IP::addr command, only put the /subnet on the network--not a host address like IP::remote_addr. Lastly, when checking the result of the active_members command, you should use == to do a numeric comparison not just =.
Can you try this?
when DNS_REQUEST {
if { [active_members Global-webservices.landsbanki.is_A10_pool] == 0 and [active_members Global-webservices.landsbanki.is_RB_pool] == 0 } {
drop
} elseif { [IP::addr [IP::remote_addr] equals 89.104.145.0/24] } {
if { [active_members Global-webservices.landsbanki.is_A10_pool] >= 1 } {
pool Global-webservices.landsbanki.is_A10_pool
} else {
pool Global-webservices.landsbanki.is_RB_pool
}
return
} elseif { [IP::addr [IP::remote_addr] equals 89.104.148.0/24] } {
if { [active_members Global-webservices.landsbanki.is_RB_pool] >= 1 } {
pool Global-webservices.landsbanki.is_RB_pool
} else {
pool Global-webservices.landsbanki.is_A10_pool
}
return
} elseif { not ([IP::addr [IP::remote_addr] equals 172.27.0.0/16] or [IP::addr [IP::remote_addr] equals 89.104.128.0/19]) } {
drop
}
}
Aaron
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