Forum Discussion
MIGUEL_MELENDEZ
Nimbostratus
Jul 13, 2006TCL error: Rule after convert irule with otcu
Hello everybody,
I am having problems with a irule converted with the utility OTCU ( from v4.5 to v9.2.3) and I am receiving the following message on /var/log/ltm
TCL error: Rule Rule-OSN-IN - Error: No serverside connection established (line 1) invoked from within "server_port"
But there is no error with the comand "b load".
This is the irule after OTCU ( irule for v9.2.3 )
rule Rule-OSN-IN {
when CLIENT_ACCEPTED {
if { [server_port] == 25 } {
use pool osn-in
}
elseif { [server_port] == 80 } {
use pool osn-in
}
elseif { [server_port] == 20 } {
use pool osn-in
}
elseif { [server_port] == 21 } {
use pool osn-in
}
elseif { [server_port] == 22 } {
use pool osn-in
}
elseif { [server_port] == 23 } {
use pool osn-in
}
elseif { [server_port] == 143 } {
use pool osn-in
}
elseif { [server_port] == 110 } {
use pool osn-in
}
elseif { [server_port] == 4201 } {
use pool osn-in
}
else {
use pool OSN-Salida_Directa
}
}
}
Could anybody help me ?
The port can be TCP or UDP.
Many thanks in advance.
- hoolio
Cirrostratus
I think the most efficient way to test the server port would be to use a switch statement. Also, the way to reference the server port in 9.x is TCP::local_port in the client side context.rule Rule-OSN-IN { when CLIENT_ACCEPTED { set vip_port [TCP::local_port] switch $vip_port { 25 { pool osn-in } 80 { pool osn-in } default { pool default_pool } } } }
- MIGUEL_MELENDEZ
Nimbostratus
Hi Hoolio, - MIGUEL_MELENDEZ
Nimbostratus
Hi, - uni
Altostratus
How about something along these lines (untested):rule Rule-OSN-IN { when CLIENT_ACCEPTED { switch [IP::protocol] { 6 { set vip_port [TCP::local_port] } 17 { set vip_port [UDP::local_port] } default { event disable } } switch $vip_port { 25 { pool osn-in } 80 { pool osn-in } default { pool default_pool } } } }
- MIGUEL_MELENDEZ
Nimbostratus
Many thanks, - JRahm
Admin
create a udp virtual server and a tcp virtual server, then apply your rule accordingly to both. Both virtuals can be on the same IP address.
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